config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config stores local configuration used by the Podmin CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheDir

func CacheDir() (string, error)

CacheDir returns Podmin's platform-aware cache directory.

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns Podmin's platform-aware configuration directory.

Types

type Context

type Context struct {
	ClusterID       string `json:"clusterID"`
	Provider        string `json:"provider"`
	Region          string `json:"region"`
	Bucket          string `json:"bucket"`
	Profile         string `json:"profile,omitempty"`
	SecretsProvider string `json:"secretsProvider"`
}

Context identifies a connected cluster.

type State

type State struct {
	Current  string             `json:"current,omitempty"`
	Contexts map[string]Context `json:"contexts"`
}

State is the complete local context configuration.

type Store

type Store struct{ Path string }

Store persists context state in one private file.

func DefaultStore

func DefaultStore() (*Store, error)

DefaultStore returns a store at the standard configuration path.

func (*Store) Current

func (s *Store) Current() (Context, error)

Current returns the selected context.

func (*Store) Load

func (s *Store) Load() (State, error)

Load reads state, returning empty state when no file exists.

func (*Store) Save

func (s *Store) Save(state State) error

Save atomically writes state with mode 0600 and syncs its directory.

Jump to

Keyboard shortcuts

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