Closed jchorl closed 4 years ago
Hi!
I'd like to instantiate my own Spotify client. Following this Google Oauth example, I want to do something like
httpClient, err := util.GetOauthClient(context.TODO(), cfg, "spotifycreds.json") if err != nil { return spotify.Client{}, fmt.Errorf("GetOauthClient(): %w", err) } return spotify.New(spotify.WithHTTPClient(httpClient)), nil
I've written generic boilerplate for generating an oauth client that I can use for multiple libs, like google's calendar lib (here)
I opted to follow the functional options pattern described here and also modified the tests to test out the new constructor.
The docs are updated to still recommend the standard auth flow.
Let me know what you think!
Closing since #123 was merged.
Hi!
I'd like to instantiate my own Spotify client. Following this Google Oauth example, I want to do something like
I've written generic boilerplate for generating an oauth client that I can use for multiple libs, like google's calendar lib (here)
I opted to follow the functional options pattern described here and also modified the tests to test out the new constructor.
The docs are updated to still recommend the standard auth flow.
Let me know what you think!