Documentation
¶
Overview ¶
Package config loads and persists CLI configuration in ~/.config/arcanecli.yml and session tokens in ~/.arcanecli/auth.json.
Index ¶
- Variables
- func AuthPath() (string, error)
- func BackupAuthFile(ctx context.Context) (backupPath string, moved bool, err error)
- func BackupFile() (backupPath string, moved bool, err error)
- func ClearTokens(ctx context.Context, cfg *types.Config) error
- func ConfigPath() (string, error)
- func DefaultConfig() *types.Config
- func InitDefaultFile() (bool, error)
- func Load() (*types.Config, error)
- func Save(ctx context.Context, c *types.Config) error
- func SaveTokens(ctx context.Context, cfg *types.Config) (err error)
- func SetConfigPath(path string) error
- func SwitchServer(ctx context.Context, cfg *types.Config, serverURL string) error
Constants ¶
This section is empty.
Variables ¶
var ( Version = "dev" Revision = "unknown" CLIStableBaseURL = "https://github.com/getarcaneapp/arcane/releases/download" CLINextBaseURL = "https://bucket.getarcane.app/bin/cli-next" )
Version and build information - set via ldflags at build time
Functions ¶
func BackupAuthFile ¶ added in v2.16.0
BackupAuthFile moves auth.json to .bak so a damaged file stops blocking saves.
func BackupFile ¶
BackupFile moves the active config to .bak, returning moved=false when no config exists.
func ClearTokens ¶ added in v2.16.0
ClearTokens removes the current server's saved session and clears tokens from the active config.
func ConfigPath ¶
ConfigPath resolves the active config path, defaulting to ~/.config/arcanecli.yml.
func DefaultConfig ¶
DefaultConfig uses localhost:3552, local environment "0", and info logging.
func InitDefaultFile ¶
InitDefaultFile creates a template with credential placeholders and returns false if the file already exists.
func SaveTokens ¶ added in v2.16.0
SaveTokens explicitly stores or removes the current server's session before saving its settings.
func SetConfigPath ¶
SetConfigPath overrides the default configuration file location. Accepts absolute or relative paths and expands a leading ~ to the home directory.
Types ¶
This section is empty.