Documentation
¶
Index ¶
- func ConfigDir() (string, error)
- func Configure(next Options)
- func SetConfigPath(path string)
- type Base
- type BaseAccessor
- type Config
- type Options
- type Store
- func (s Store[T]) Current() (*T, string, error)
- func (s Store[T]) DeleteContext(name string) error
- func (s Store[T]) Load() (*Config[T], error)
- func (s Store[T]) Save(cfg *Config[T]) error
- func (s Store[T]) SetContext(name string, ctx T) error
- func (s Store[T]) Update(fn func(cfg *Config[T]) error) error
- func (s Store[T]) UseContext(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Configure ¶
func Configure(next Options)
Configure sets package-level context storage defaults for a consumer CLI.
func SetConfigPath ¶
func SetConfigPath(path string)
SetConfigPath overrides the default config path for this process.
Types ¶
type Base ¶
type Base struct {
Server string `yaml:"server"`
Username string `yaml:"username,omitempty"`
Password string `yaml:"password,omitempty"`
Env string `yaml:"env,omitempty"`
Protected bool `yaml:"protected,omitempty"`
TicketPattern string `yaml:"ticketPattern,omitempty"`
TicketValidator string `yaml:"ticketValidator,omitempty"`
CredentialBackend string `yaml:"credentialBackend,omitempty"`
Roles map[string]string `yaml:"roles,omitempty"`
RolesSource string `yaml:"rolesSource,omitempty"`
RolesURL string `yaml:"rolesURL,omitempty"`
AllowInsecureRolesURL bool `yaml:"allowInsecureRolesURL,omitempty"`
OTLPEndpoint string `yaml:"otlpEndpoint,omitempty"`
OTLPEndpointSource string `yaml:"otlpEndpointSource,omitempty"`
OTLPMetricsEndpoint string `yaml:"otlpMetricsEndpoint,omitempty"`
OTLPMetricsSource string `yaml:"otlpMetricsSource,omitempty"`
OTLPInsecure bool `yaml:"otlpInsecure,omitempty"`
OTLPRedact bool `yaml:"otlpRedact"`
OTLPRedactApp string `yaml:"otlpRedactApp,omitempty"`
AuditMaxSize int64 `yaml:"auditMaxSize,omitempty"`
AuditEncryptKey string `yaml:"auditEncryptKey,omitempty"`
BackupKeep int `yaml:"backupKeep"`
VaultAddr string `yaml:"vaultAddr,omitempty"`
VaultPath string `yaml:"vaultPath,omitempty"`
VaultRoleID string `yaml:"vaultRoleID,omitempty"`
VaultNamespace string `yaml:"vaultNamespace,omitempty"`
}
Base contains common context fields shared by governed CLI tools.
type BaseAccessor ¶
type Config ¶
type Config[T any] struct { APIVersion string `yaml:"apiVersion"` CurrentContext string `yaml:"current-context"` Contexts map[string]T `yaml:"contexts"` }
Config is the top-level context file structure.
type Store ¶
type Store[T any] struct { // contains filtered or unexported fields }
Store provides typed context persistence for a CLI-specific context type.
func NewStore ¶
func NewStore[T any](base BaseAccessor[T]) Store[T]
NewStore creates a typed context store.
func NewStoreWithoutBase ¶
NewStoreWithoutBase creates a typed context store for schemas that do not embed Base.
func (Store[T]) DeleteContext ¶
DeleteContext removes a context.
func (Store[T]) SetContext ¶
SetContext adds or updates a context.
func (Store[T]) UseContext ¶
UseContext switches the current context.
Click to show internal directories.
Click to hide internal directories.