config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() (string, error)

DefaultPath returns the preferred config file path for bndry.

If BNDRY_CONFIG is set, that path is used. Otherwise, bndry will reuse the first existing config file it finds in ~/.config/bndry/, falling back to config.yaml when nothing exists yet.

Types

type Config

type Config struct {
	BoundaryAddr              string `json:"boundary_addr" mapstructure:"boundary_addr"`
	OIDCAuthMethodID          string `json:"oidc_auth_method_id" mapstructure:"oidc_auth_method_id"`
	AuthToken                 string `json:"auth_token,omitempty" mapstructure:"auth_token"`
	DefaultProjectScopeID     string `json:"default_project_scope_id" mapstructure:"default_project_scope_id"`
	DefaultCatalogName        string `json:"default_catalog_name" mapstructure:"default_catalog_name"`
	DefaultHostSetName        string `json:"default_host_set_name" mapstructure:"default_host_set_name"`
	DefaultRoleName           string `json:"default_role_name" mapstructure:"default_role_name"`
	DefaultPrincipalID        string `json:"default_principal_id,omitempty" mapstructure:"default_principal_id"`
	DefaultTargetPort         int    `json:"default_target_port" mapstructure:"default_target_port"`
	DefaultCreateRole         bool   `json:"default_create_role" mapstructure:"default_create_role"`
	DefaultConnectAfterCreate bool   `json:"default_connect_after_create" mapstructure:"default_connect_after_create"`
	AutoSelectDefaultScope    bool   `json:"auto_select_default_scope" mapstructure:"auto_select_default_scope"`
	LastHostCatalogID         string `json:"last_host_catalog_id,omitempty" mapstructure:"last_host_catalog_id"`
}

Config stores universal defaults and saved values for bndry.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the built-in defaults for bndry configuration.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store persists bndry configuration on disk.

func NewStore

func NewStore(path string) (*Store, error)

NewStore creates a config store. If path is empty, the default path is used.

func (*Store) Init

func (s *Store) Init() error

Init writes a new config file populated with the built-in defaults.

func (*Store) Load

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

Load reads the effective configuration using Viper defaults, config files, and environment overrides.

func (*Store) Path

func (s *Store) Path() string

Path returns the fully-qualified location of the config file.

func (*Store) Save

func (s *Store) Save(cfg Config) error

Save writes the config file with secure permissions.

Jump to

Keyboard shortcuts

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