Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Word WordsManager // contains filtered or unexported fields }
Client represents the dictionary api client.
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
NewClient returns a instance of Client with the default settings. These settings can be optionally modified using ClientOptions that can be passed to NewClient.
type ClientOption ¶
type ClientOption func(*Client)
ClientOption are additional settings that can be passed to the Client.
func WithHTTPClient ¶
func WithHTTPClient(httpClient *resty.Client) ClientOption
WithHTTPClient can be used as a ClientOption to pass a custom httpClient.
func WithWordsManager ¶
func WithWordsManager(wm WordsManager) ClientOption
WithWordsManager can be used as a ClientIOption to pass a custom implementation of the WordsManage interface.
type Definitions ¶
type Definitions struct { Definition string `json:"definition"` Example string `json:"example"` Synonyms []interface{} `json:"synonyms"` Antonyms []interface{} `json:"antonyms"` }
Definitions represent a statement of the exact meaning of the Word.
type Error ¶
type Error struct { Title string `json:"title"` Message string `json:"message"` StatusCode int `json:"statusCode"` Resolution string `json:"resolution"` }
Error represents the error returned by the dictionary api.
type Meanings ¶
type Meanings struct { PartOfSpeech string `json:"partOfSpeech"` Definitions []Definitions `json:"definitions"` }
Meanings represents the different meanings of the Word