Documentation
¶
Index ¶
- func PrivateTempDir(parent, prefix string) (string, error)
- func ValidateSettings(settings Settings) error
- type Credentials
- type Settings
- type Store
- func (s *Store) CredentialStore() (string, error)
- func (s *Store) Dir() string
- func (s *Store) Load() (Credentials, error)
- func (s *Store) LoadSettings() (Settings, error)
- func (s *Store) Logout() error
- func (s *Store) Path() string
- func (s *Store) Save(credentials Credentials) error
- func (s *Store) SaveSettings(settings Settings) error
- func (s *Store) Storage() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrivateTempDir ¶
PrivateTempDir creates a private directory before a browser can write session data into it.
func ValidateSettings ¶
Types ¶
type Credentials ¶
type Credentials struct {
AuthToken string `json:"authToken"`
PartnerUserID string `json:"partnerUserID"`
PartnerUserSecret string `json:"partnerUserSecret"`
Email string `json:"email,omitempty"`
AccountID int64 `json:"accountID,omitempty"`
}
func Resolve ¶
func Resolve(stored Credentials) (Credentials, string, error)
Resolve keeps environment credentials isolated from a saved account's refresh credentials.
type Settings ¶
type Settings struct {
Output string `json:"output"`
PolicyID string `json:"policyID,omitempty"`
Currency string `json:"currency"`
Timeout string `json:"timeout"`
}
func DefaultSettings ¶
func DefaultSettings() Settings
func LoadSettings ¶
LoadSettings applies defaults, user configuration, project configuration, then environment settings.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) CredentialStore ¶
CredentialStore returns the configured storage preference without accessing secrets.
func (*Store) Load ¶
func (s *Store) Load() (Credentials, error)
func (*Store) LoadSettings ¶
func (*Store) Save ¶
func (s *Store) Save(credentials Credentials) error