Documentation ¶
Index ¶
- type Client
- type ClientImpl
- func (c *ClientImpl) Lookup(ctx context.Context, name string, params LookupParams) (*LookupResponse, error)
- func (c *ClientImpl) RandomName(ctx context.Context, params RandomNameParameters) (*RandomNameResponse, error)
- func (c *ClientImpl) RelatedNames(ctx context.Context, name string, params RelatedNamesParameters) (*RelatedNamesResponse, error)
- type ErrResponse
- type LookupParams
- type LookupResponse
- type LookupResponseElement
- type RandomNameParameters
- type RandomNameResponse
- type RelatedNamesParameters
- type RelatedNamesResponse
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Lookup(ctx context.Context, name string) (result []byte, err error) RandomName(ctx context.Context) (result []byte, err error) RelatedNames(ctx context.Context, name string) (result []byte, err error) }
Client is an interface to behindthenames api
type ClientImpl ¶
type ClientImpl struct {
// contains filtered or unexported fields
}
ClientImpl is an implementation of the poeditor client interface
func NewClient ¶
func NewClient(apiToken string, httpClient *http.Client) *ClientImpl
NewClient creates a new poeditor api client
func (*ClientImpl) Lookup ¶
func (c *ClientImpl) Lookup(ctx context.Context, name string, params LookupParams) (*LookupResponse, error)
Lookup will return information about a given name. https://www.behindthename.com/api/help.php
func (*ClientImpl) RandomName ¶
func (c *ClientImpl) RandomName(ctx context.Context, params RandomNameParameters) (*RandomNameResponse, error)
RandomName will return a random name. https://www.behindthename.com/api/help.php
func (*ClientImpl) RelatedNames ¶
func (c *ClientImpl) RelatedNames(ctx context.Context, name string, params RelatedNamesParameters) (*RelatedNamesResponse, error)
RelatedNames will return potential aliases for a given name. https://www.behindthename.com/api/help.php
type ErrResponse ¶
type LookupParams ¶
type LookupParams struct {
Exact bool
}
type LookupResponse ¶
type LookupResponse []LookupResponseElement
type LookupResponseElement ¶
type RandomNameParameters ¶
type RandomNameResponse ¶
type RandomNameResponse struct { ErrorCode int `json:"error_code,omitempty" yaml:"error_code,omitempty"` Error string `json:"error,omitempty" yaml:"error,omitempty"` Names []string `json:"names,omitempty" yaml:"names,omitempty"` }
func (*RandomNameResponse) GetNames ¶
func (r *RandomNameResponse) GetNames() []string
type RelatedNamesParameters ¶
type RelatedNamesResponse ¶
type RelatedNamesResponse struct { ErrorCode int `json:"error_code,omitempty" yaml:"error_code,omitempty"` Error string `json:"error,omitempty" yaml:"error,omitempty"` Names []string `json:"names,omitempty" yaml:"names,omitempty"` }
func (*RelatedNamesResponse) GetNames ¶
func (r *RelatedNamesResponse) GetNames() []string
Click to show internal directories.
Click to hide internal directories.