-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: separate api config to pkg/
- Loading branch information
Showing
4 changed files
with
38 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package config | ||
|
||
import ( | ||
"github.com/sirupsen/logrus" | ||
"time" | ||
) | ||
|
||
type CachedToken struct { | ||
RefreshToken string | ||
AccessToken string | ||
ExpiryDate time.Time | ||
Type string | ||
} | ||
|
||
type Config struct { | ||
// required authentication credentials | ||
Credentials struct { | ||
ClientID string | ||
ClientSecret string | ||
} | ||
|
||
// optional open a browser to complete authentication if user interaction is required | ||
OpenBrowser bool | ||
|
||
// optional token cache if caching previous credentials | ||
TokenCache *CachedToken | ||
|
||
// optional logger instance | ||
Logger *logrus.Logger | ||
} |