lego/vendor/github.com/namedotcom/go/namecom/hello.go
Ludovic Fernandez 6004e599ed Manage vendor (#557)
* feat: add dep configuration files.

* chore: add vendor folder.

* refactor: update Dockerfile.

* review: remove git from Dockerfile.

* review: remove RUN apk.

* review: dep status.

* feat: added .dockerignore
2018-05-30 16:28:41 -06:00

31 lines
502 B
Go

package namecom
import (
"bytes"
"encoding/json"
"fmt"
"net/url"
)
var _ = bytes.MinRead
// HelloFunc returns some information about the API server.
func (n *NameCom) HelloFunc(request *HelloRequest) (*HelloResponse, error) {
endpoint := fmt.Sprintf("/v4/hello")
values := url.Values{}
body, err := n.get(endpoint, values)
if err != nil {
return nil, err
}
resp := &HelloResponse{}
err = json.NewDecoder(body).Decode(resp)
if err != nil {
return nil, err
}
return resp, nil
}