config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName    = "cb365"
	AppVersion = "0.1.0-dev"
)

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the config directory path

func ConfigPath

func ConfigPath() (string, error)

ConfigPath returns the full path to the config file

Types

type AuthMode

type AuthMode string

AuthMode represents the authentication mode

const (
	AuthModeDelegated AuthMode = "delegated"
	AuthModeAppOnly   AuthMode = "app-only"
)

type Config

type Config struct {
	ActiveProfile string              `json:"active_profile"`
	Profiles      map[string]*Profile `json:"profiles"`
	Settings      Settings            `json:"settings"`
}

Config represents the cb365 configuration file

func Load

func Load() (*Config, error)

Load reads the config from disk

func (*Config) ActiveProfileConfig

func (c *Config) ActiveProfileConfig() (*Profile, error)

ActiveProfileConfig returns the currently active profile

func (*Config) Save

func (c *Config) Save() error

Save writes the config to disk

func (*Config) SetActiveProfile

func (c *Config) SetActiveProfile(name string) error

SetActiveProfile switches the active profile

type Profile

type Profile struct {
	Name     string   `json:"name"`
	TenantID string   `json:"tenant_id"`
	ClientID string   `json:"client_id"`
	AuthMode AuthMode `json:"auth_mode"`
	Scopes   []string `json:"scopes,omitempty"`
	Username string   `json:"username,omitempty"`
	Active   bool     `json:"active,omitempty"`
}

Profile represents a configured authentication profile

type Settings

type Settings struct {
	IPv4Only bool `json:"ipv4_only,omitempty"`
}

Settings holds global CLI settings

Jump to

Keyboard shortcuts

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