diff --git a/client/client.go b/client/client.go index 11c4a70..f6475ad 100644 --- a/client/client.go +++ b/client/client.go @@ -131,8 +131,10 @@ func Do(request *http.Request) (*jsh.Document, *http.Response, error) { return doc, response, parseErr } -// ParseResponse handles parsing an HTTP response into a JSON Document if -// possible +/* +ParseResponse handles parsing an HTTP response into a JSON Document if +possible. +*/ func ParseResponse(response *http.Response) (*jsh.Document, error) { skipCodes := []int{ diff --git a/client/delete.go b/client/delete.go index 893c036..32d6910 100644 --- a/client/delete.go +++ b/client/delete.go @@ -8,10 +8,11 @@ import ( "github.com/derekdowling/go-json-spec-handler" ) -// Delete allows a user to make an outbound "DELETE /resource/:id" request. -// -// resp, err := jsh.Delete("http://apiserver", "user", "2") -// +/* +Delete allows a user to make an outbound "DELETE /resource/:id" request. + + resp, err := jsh.Delete("http://apiserver", "user", "2") +*/ func Delete(urlStr string, resourceType string, id string) (*http.Response, error) { request, err := DeleteRequest(urlStr, resourceType, id) if err != nil { @@ -26,9 +27,11 @@ func Delete(urlStr string, resourceType string, id string) (*http.Response, erro return response, nil } -// DeleteRequest returns a fully formatted request for performing a JSON API DELETE. -// This is useful for if you need to set custom headers on the request. Otherwise -// just use "jsc.Delete". +/* +DeleteRequest returns a fully formatted request for performing a JSON API DELETE. +This is useful for if you need to set custom headers on the request. Otherwise +just use "jsc.Delete". +*/ func DeleteRequest(urlStr string, resourceType string, id string) (*http.Request, error) { u, err := url.Parse(urlStr) if err != nil { diff --git a/client/get.go b/client/get.go index 4ff1a4f..e03418b 100644 --- a/client/get.go +++ b/client/get.go @@ -18,8 +18,10 @@ func Fetch(baseURL string, resourceType string, id string) (*jsh.Document, *http return Do(request) } -// FetchRequest returns a fully formatted JSONAPI Fetch request. Useful if you need to -// set custom headers before proceeding. Otherwise just use "jsh.Fetch". +/* +FetchRequest returns a fully formatted JSONAPI Fetch request. Useful if you need to +set custom headers before proceeding. Otherwise just use "jsh.Fetch". +*/ func FetchRequest(baseURL string, resourceType, id string) (*http.Request, error) { if id == "" { return nil, jsh.SpecificationError("ID cannot be empty for GetObject request type") @@ -45,8 +47,10 @@ func List(baseURL string, resourceType string) (*jsh.Document, *http.Response, e return Do(request) } -// ListRequest returns a fully formatted JSONAPI List request. Useful if you need to -// set custom headers before proceeding. Otherwise just use "jsh.List". +/* +ListRequest returns a fully formatted JSONAPI List request. Useful if you need to +set custom headers before proceeding. Otherwise just use "jsh.List". +*/ func ListRequest(baseURL string, resourceType string) (*http.Request, error) { u, urlErr := url.Parse(baseURL) if urlErr != nil {