config

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrivateTempDir

func PrivateTempDir(parent, prefix string) (string, error)

PrivateTempDir creates a private directory before a browser can write session data into it.

func ValidateSettings

func ValidateSettings(settings Settings) error

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

func LoadSettings(store *Store) (Settings, error)

LoadSettings applies defaults, user configuration, project configuration, then environment settings.

type Store

type Store struct {
	// contains filtered or unexported fields
}

func New

func New(dir string) *Store

func (*Store) CredentialStore

func (s *Store) CredentialStore() (string, error)

CredentialStore returns the configured storage preference without accessing secrets.

func (*Store) Dir

func (s *Store) Dir() string

func (*Store) Load

func (s *Store) Load() (Credentials, error)

func (*Store) LoadSettings

func (s *Store) LoadSettings() (Settings, error)

func (*Store) Logout

func (s *Store) Logout() error

func (*Store) Path

func (s *Store) Path() string

func (*Store) Save

func (s *Store) Save(credentials Credentials) error

func (*Store) SaveSettings

func (s *Store) SaveSettings(settings Settings) error

func (*Store) Storage

func (s *Store) Storage() string

Storage reports the backend after the last successful credential operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL