Create Credentials struct

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-08-23 22:25:29 -04:00
parent ae6fbd2614
commit ba5eea5ed4
9 changed files with 84 additions and 64 deletions
-11
View File
@@ -35,17 +35,6 @@ func FromEnv(c *Client) error {
return nil
}
// WithCredentials sets the necessary values for the client to authenticate via OAuth2.
func WithCredentials(id, secret, username, password string) Opt {
return func(c *Client) error {
c.ID = id
c.Secret = secret
c.Username = username
c.Password = password
return nil
}
}
// WithBaseURL sets the base URL for the client to make requests to.
func WithBaseURL(u string) Opt {
return func(c *Client) error {