config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromptForInput

func PromptForInput(prompt string) (string, error)

PromptForInput prompts the user for input with a given message.

func PromptForPassword

func PromptForPassword(prompt string) (string, error)

PromptForPassword prompts the user for a password input with masking. The input will not be displayed on the screen as it's being typed.

func Save

func Save(cfg *Config) error

Save writes the configuration to the file system in ~/.config/kez. It creates the necessary directories if they don't exist.

Types

type BuildkiteConfig

type BuildkiteConfig struct {
	Token   string `json:"token,omitempty"` // Deprecated: kept for migration, use keyring
	OrgSlug string `json:"org_slug"`
}

BuildkiteConfig holds Buildkite specific settings. Note: API token is stored securely in the system keyring, not in this file.

type Config

type Config struct {
	Buildkite      BuildkiteConfig  `json:"buildkite"`
	Kubernetes     KubernetesConfig `json:"kubernetes"`
	RecentClusters []RecentCluster  `json:"recent_clusters"`
}

Config represents the application's configuration.

func DefaultConfig

func DefaultConfig() *Config

Default values for a new configuration.

func Load

func Load() (*Config, error)

Load reads the configuration from ~/.config/kez. If the file doesn't exist, it creates the directory and returns a default configuration.

func (*Config) GetBuildkiteAPIToken added in v0.2.0

func (c *Config) GetBuildkiteAPIToken() (string, error)

GetBuildkiteAPIToken retrieves the Buildkite API token from keyring

func (*Config) SetBuildkiteAPIToken added in v0.2.0

func (c *Config) SetBuildkiteAPIToken(token string) error

SetBuildkiteAPIToken stores the Buildkite API token in keyring and updates config

type KubernetesConfig

type KubernetesConfig struct {
	PreferredProvider string `json:"preferred_provider"`
}

KubernetesConfig holds Kubernetes specific settings.

type RecentCluster

type RecentCluster struct {
	UUID     string `json:"uuid"`
	Name     string `json:"name"`
	OrgSlug  string `json:"org_slug"`
	TokenID  string `json:"token_id,omitempty"`  // ID of the cluster token
	TokenVal string `json:"token_val,omitempty"` // Deprecated: kept for migration, use keyring
}

RecentCluster holds information about a recently used cluster. Note: Token values are stored securely in the system keyring, not in this file.

Jump to

Keyboard shortcuts

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