Documentation
¶
Index ¶
Constants ¶
View Source
const TokenKeyringSuffix = "-TokenInfo"
Variables ¶
View Source
var ErrNotFound = keyring.ErrKeyNotFound
Functions ¶
This section is empty.
Types ¶
type ConfigFile ¶
type ConfigFile struct {
Path string
// contains filtered or unexported fields
}
func LoadConfig ¶
func LoadConfig() (*ConfigFile, error)
func (*ConfigFile) Add ¶
func (c *ConfigFile) Add(profile ProfileSection) error
Add the profile to the configuration file
func (*ConfigFile) ProfileNames ¶
func (c *ConfigFile) ProfileNames() []string
func (*ConfigFile) ProfileSection ¶
func (c *ConfigFile) ProfileSection(name string) (ProfileSection, bool)
ProfileSection returns the profile section with the matching name. If there isn't any, an empty profile with the provided name is returned, along with false.
func (*ConfigFile) ProfileSections ¶
func (c *ConfigFile) ProfileSections() []ProfileSection
ProfileSections returns all the profile sections in the config
func (*ConfigFile) Save ¶
func (c *ConfigFile) Save() error
type ConfigLoader ¶
type ConfigLoader struct {
File *ConfigFile
ActiveProfile string
}
func NewConfigLoader ¶
func NewConfigLoader(file *ConfigFile, activeProfile string) *ConfigLoader
func (*ConfigLoader) GetProfileConfig ¶
func (cl *ConfigLoader) GetProfileConfig(profileName string) (*Config, error)
type CredentialKeyring ¶
func (*CredentialKeyring) Get ¶
func (ck *CredentialKeyring) Get(credentialsName string) (creds *Credentials, err error)
func (*CredentialKeyring) Remove ¶
func (ck *CredentialKeyring) Remove(credentialsName string) error
func (*CredentialKeyring) Set ¶
func (ck *CredentialKeyring) Set(credentialsName string, creds Credentials) error
type Credentials ¶
type ProfileSection ¶
type ProfileSection struct {
Name string `ini:"-"`
GrantType string `ini:"grant_type"`
AuthServerAuthEndpoint string `ini:"auth_server_auth_endpoint"`
AuthServerTokenEndpoint string `ini:"auth_server_token_endpoint"`
Redirect string `ini:"redirect"`
Scope string `ini:"scopes"`
ContentType string `ini:"content_type"`
UserAgent string `ini:"user_agent"`
}
ProfileSection is a profile section of the config file
func (ProfileSection) IsEmpty ¶
func (s ProfileSection) IsEmpty() bool
type TokenInfo ¶
type TokenKeyring ¶
func (*TokenKeyring) Get ¶
func (tkr *TokenKeyring) Get(profileName string) (tokenInfo *TokenInfo, err error)
func (*TokenKeyring) Remove ¶
func (tkr *TokenKeyring) Remove(profileName string) error
type Tokens ¶
type Tokens struct {
AccessToken string `json:"access_token"`
IdToken string `json:"id_token"`
TokenType string `json:"token_type"`
RefreshToken string `json:"refresh_token"`
Scope string `json:"scope"`
ExpiresIn *int64 `json:"expires_in"`
Expires *int64 `json:"expires"` // broken Facebook spelling of expires_in
}
Click to show internal directories.
Click to hide internal directories.