tiny-url-ex/root/useri.go

37 lines
806 B
Go
Raw Normal View History

package main
import (
"fmt"
2018-07-05 17:19:39 +00:00
e "git.xdrm.io/go/aicra/err"
i "git.xdrm.io/go/aicra/implement"
)
func Get(d i.Arguments, r *i.Response) i.Response {
fmt.Printf("GET /user\n")
r.Set("method_test", "Get")
r.Set("received_data", d)
r.Err = e.Upload
return *r
}
func Post(d i.Arguments, r *i.Response) i.Response {
fmt.Printf("POST /user\n")
r.Set("method_test", "Post")
r.Set("received_data", d)
r.Err = e.Download
return *r
}
func Put(d i.Arguments, r *i.Response) i.Response {
fmt.Printf("PUT /user\n")
r.Set("method_test", "Put")
r.Set("received_data", d)
r.Err = e.MissingDownloadHeaders
return *r
}
func Delete(d i.Arguments, r *i.Response) i.Response {
fmt.Printf("DELETE /user\n")
r.Set("method_test", "Delete")
r.Set("received_data", d)
r.Err = e.MissingDownloadBody
return *r
}