MCPcopy Create free account
hub / github.com/crewjam/saml / CreateLink

Function CreateLink

example/service.go:35–46  ·  view source on GitHub ↗

CreateLink handles requests to create links

(c web.C, w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

33
34// CreateLink handles requests to create links
35func CreateLink(c web.C, w http.ResponseWriter, r *http.Request) {
36 account := r.Header.Get("X-Remote-User")
37 l := Link{
38 ShortLink: uniuri.New(),
39 Target: r.FormValue("t"),
40 Owner: account,
41 }
42 links[l.ShortLink] = l
43
44 fmt.Fprintf(w, "%s\n", l.ShortLink)
45 return
46}
47
48// ServeLink handles requests to redirect to a link
49func ServeLink(c web.C, w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 2

GetMethod · 0.65
NewMethod · 0.65

Tested by

no test coverage detected