- Most simple way is to use the Interface defined in client_factory.go,
ApiClientActions
. - Implement the 3 methods for Your client factory:
HandleAuthorization
- this method is for handling the authorization step in the OAuth2 flow, can access the OAuth config, to fetch the authorization URL.
SaveTokens
- this method is for saving the OAuth2 tokens. An Oauth tokens object is provided as an input argument.
FetchTokens
- this method is used for fetching extisting OAuth2 tokens, so the Authorization flow could be skipped, if an existing OAuth2 connection has been created previously. It must return anoauth2.Token
object. scoro.GetClient
will return a API client object that has all the CRUD operations implemented. It takes the client config and the implementation of the client factory object as arguments.- You can create the
ApiConfig
object manually, or use theGetAPIClientConfigFromEnvFile
which can read the connection parameters from an .env file stored in the root directory of Your app which uses this SDK. - See the example client factory implementation in
examples/example_client.go
.
-
Notifications
You must be signed in to change notification settings - Fork 1
scoro-api/v3-go-sdk
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Packages 0
No packages published