Documentation
¶
Overview ¶
Package config manages Upbit CLI credentials stored in $HOME/.upbit/config.
Credential resolution priority:
- Environment variables: UPBIT_ACCESS_KEY, UPBIT_SECRET_KEY
- Config file: $HOME/.upbit/config (TOML, [default] section)
- Empty — callers decide how to handle absence
Config file format:
[default] access_key = "..." secret_key = "..."
The file is created/updated exclusively via Save, which enforces 0600 permissions and creates the parent directory (0700) if absent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Save ¶
func Save(c Credentials) error
Save writes credentials to $HOME/.upbit/config with 0600 permissions.
Types ¶
type Credentials ¶
type Credentials struct {
AccessKey string
SecretKey string
AccessKeySource Source
SecretKeySource Source
}
Credentials holds the access/secret key pair along with their load sources.
func Load ¶
func Load() (Credentials, error)
Load reads credentials with priority: env > ~/.upbit/config > empty.
func LoadFile ¶
func LoadFile() (Credentials, error)
LoadFile reads credentials from the config file only (no env lookup).
func (Credentials) IsEmpty ¶
func (c Credentials) IsEmpty() bool
IsEmpty reports whether both keys are absent.
Click to show internal directories.
Click to hide internal directories.