config

package
v0.0.0-...-73a7dcf Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvSandbox    = "sandbox"
	EnvProduction = "production"
)

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

func ConfigPath

func ConfigPath() (string, error)

func CredentialsPath

func CredentialsPath() (string, error)

func Save

func Save(cfg File) error

func SaveCredentials

func SaveCredentials(credentials CredentialsFile) error

Types

type CredentialEntry

type CredentialEntry struct {
	Profile     string `json:"profile"`
	Environment string `json:"environment"`
	APIKey      string `json:"api_key"`
	UpdatedAt   string `json:"updated_at"`
	Source      string `json:"source,omitempty"`
}

type CredentialsFile

type CredentialsFile struct {
	Profiles map[string]CredentialEntry `json:"profiles"`
}

func DefaultCredentialsFile

func DefaultCredentialsFile() CredentialsFile

func LoadCredentials

func LoadCredentials() (CredentialsFile, error)

type File

type File struct {
	DefaultProfile string             `json:"default_profile"`
	Profiles       map[string]Profile `json:"profiles"`
}

func DefaultConfig

func DefaultConfig() File

func Load

func Load() (File, error)

type Profile

type Profile struct {
	Name            string      `json:"name"`
	Environment     string      `json:"environment"`
	StorageMode     StorageMode `json:"storage_mode"`
	KeychainAccount string      `json:"keychain_account,omitempty"`
	// ConfigToken is retained for migration from the original inline secret storage.
	ConfigToken        string `json:"config_token,omitempty"`
	LastKnownEntity    string `json:"last_known_entity,omitempty"`
	LastKnownRequestID string `json:"last_known_request_id,omitempty"`
}

type StorageMode

type StorageMode string
const (
	StorageModeAuto     StorageMode = "auto"
	StorageModeFile     StorageMode = "file"
	StorageModeKeychain StorageMode = "keychain"
	StorageModeConfig   StorageMode = "config"
)

func NormalizeStorageMode

func NormalizeStorageMode(mode StorageMode) StorageMode

Jump to

Keyboard shortcuts

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