profile

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

ConfigDir returns the directory for pinax config files.

func ProfilesPath

func ProfilesPath() string

ProfilesPath returns the path to profiles.yaml.

func ResolveSecretRef

func ResolveSecretRef(ref string) (string, error)

ResolveSecretRef resolves a secret reference to the actual secret value.

func ResolveTarget

func ResolveTarget(target string) (endpoint, workspace, device, secretRef string, err error)

ResolveTarget resolves a target string to backend connection parameters. If target matches a profile name, returns that profile's parameters. If target is a URI (contains ://), returns it as-is for endpoint.

func Save

func Save(cfg *ProfilesConfig) error

Save writes profiles to disk.

Types

type Profile

type Profile struct {
	Endpoint     string `yaml:"endpoint" json:"endpoint"`
	Workspace    string `yaml:"workspace" json:"workspace,omitempty"`
	Device       string `yaml:"device" json:"device,omitempty"`
	SecretRef    string `yaml:"secret_ref,omitempty" json:"secret_ref,omitempty"`
	DefaultScope string `yaml:"default_scope,omitempty" json:"default_scope,omitempty"`
}

Profile represents a named backend connection configuration.

type ProfilesConfig

type ProfilesConfig struct {
	Profiles map[string]Profile `yaml:"profiles"`
	Defaults struct {
		Profile      string `yaml:"profile,omitempty"`
		WriteProfile string `yaml:"write_profile,omitempty"`
	} `yaml:"defaults,omitempty"`
}

ProfilesConfig holds all profiles and defaults.

func Load

func Load() (*ProfilesConfig, error)

Load reads profiles from disk.

Jump to

Keyboard shortcuts

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