Initial release
This commit is contained in:
commit
70d1d6bce8
9 changed files with 576 additions and 0 deletions
26
options.go
Normal file
26
options.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package sendamatic
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Option func(*Client)
|
||||
|
||||
func WithBaseURL(baseURL string) Option {
|
||||
return func(c *Client) {
|
||||
c.baseURL = baseURL
|
||||
}
|
||||
}
|
||||
|
||||
func WithHTTPClient(client *http.Client) Option {
|
||||
return func(c *Client) {
|
||||
c.httpClient = client
|
||||
}
|
||||
}
|
||||
|
||||
func WithTimeout(timeout time.Duration) Option {
|
||||
return func(c *Client) {
|
||||
c.httpClient.Timeout = timeout
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue