Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v2.17.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package config loads and persists CLI configuration in ~/.config/arcanecli.yml and session tokens in ~/.arcanecli/auth.json.

Index

Constants

This section is empty.

Variables

View Source
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 AuthPath added in v2.16.0

func AuthPath() (string, error)

AuthPath returns the session token file, ~/.arcanecli/auth.json.

func BackupAuthFile added in v2.16.0

func BackupAuthFile(ctx context.Context) (backupPath string, moved bool, err error)

BackupAuthFile moves auth.json to .bak so a damaged file stops blocking saves.

func BackupFile

func BackupFile() (backupPath string, moved bool, err error)

BackupFile moves the active config to .bak, returning moved=false when no config exists.

func ClearTokens added in v2.16.0

func ClearTokens(ctx context.Context, cfg *types.Config) error

ClearTokens removes the current server's saved session and clears tokens from the active config.

func ConfigPath

func ConfigPath() (string, error)

ConfigPath resolves the active config path, defaulting to ~/.config/arcanecli.yml.

func DefaultConfig

func DefaultConfig() *types.Config

DefaultConfig uses localhost:3552, local environment "0", and info logging.

func InitDefaultFile

func InitDefaultFile() (bool, error)

InitDefaultFile creates a template with credential placeholders and returns false if the file already exists.

func Load

func Load() (*types.Config, error)

Load reads configuration, using defaults when the file does not exist.

func Save

func Save(ctx context.Context, c *types.Config) error

Save writes settings with mode 0600 without changing saved sessions.

func SaveTokens added in v2.16.0

func SaveTokens(ctx context.Context, cfg *types.Config) (err error)

SaveTokens explicitly stores or removes the current server's session before saving its settings.

func SetConfigPath

func SetConfigPath(path string) error

SetConfigPath overrides the default configuration file location. Accepts absolute or relative paths and expands a leading ~ to the home directory.

func SwitchServer added in v2.16.0

func SwitchServer(ctx context.Context, cfg *types.Config, serverURL string) error

SwitchServer points cfg at serverURL and loads that server's saved session without changing auth.json.

Types

This section is empty.

Jump to

Keyboard shortcuts

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