Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultHost = "localhost:8080" DefaultTimeout = 1 * time.Minute )
Default settings for the client.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an api client with an underlying http.Client instance.
func (Client) CharTrigram ¶
CharTrigram issues a new request for the given char-trigrams to the host and returns its response.
type Opt ¶
type Opt func(*Client)
Opt is a functional option.
func WithHost ¶
WithHost defines a custom host configuration. c := client.New(client.WithHost("myhost"))
func WithLogger ¶
WithLogger sets the logger for the client to use. c := client.New(client.WithLogger(logger.New(...)))
func WithTimeout ¶
WithTimeout defines a custom timeout configuration c := client.New(client.WithTimeout(10 * time.Second))
Click to show internal directories.
Click to hide internal directories.