-
Notifications
You must be signed in to change notification settings - Fork 0
/
http.go
30 lines (23 loc) · 786 Bytes
/
http.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package auth
import (
"net/http"
"net/url"
h "github.com/czertbytes/pocket/pkg/http"
t "github.com/czertbytes/pocket/pkg/types"
)
const (
LocationPath = "http://api.tripmoneymgmt.com/manager/clients"
)
func Post(url *url.URL, header http.Header, client *t.Client, requestContext *h.RequestContext) (int, http.Header, *t.Client, error) {
newClient, err := NewController(requestContext).Post(client)
if err != nil {
return 0, nil, nil, err
}
return http.StatusCreated, nil, &newClient, nil
}
func Delete(url *url.URL, header http.Header, _ interface{}, requestContext *h.RequestContext) (int, http.Header, interface{}, error) {
if err := NewController(requestContext).Delete(url); err != nil {
return 0, nil, nil, err
}
return http.StatusNoContent, nil, nil, nil
}