profile

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package profile provides CRUD operations on named connection profiles persisted in siphon's config file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is the runtime API for managing profiles.

func New

func New(cfg *config.Config, res *secrets.Resolver, save func(*config.Config) error) *Store

New creates a Store backed by cfg. The save function controls persistence; pass config.Save in production, or a no-op for tests.

func (*Store) Add

func (s *Store) Add(name string, p config.ProfileConfig) error

Add stores a new profile. Returns an error if name already exists. Always sets p.Name = name to keep the Name field consistent with the map key (which Load() also enforces on reload).

func (*Store) Get

func (s *Store) Get(name string) (config.ProfileConfig, error)

Get returns the unresolved profile (Password is still a SecretRef).

func (*Store) List

func (s *Store) List() []string

List returns all profile names, sorted alphabetically.

func (*Store) Remove

func (s *Store) Remove(name string) error

Remove deletes a profile by name.

func (*Store) Resolve

func (s *Store) Resolve(name string) (driver.Profile, error)

Resolve returns a driver.Profile with secrets materialized.

func (*Store) Update

func (s *Store) Update(name string, p config.ProfileConfig) error

Update overwrites an existing profile. Sets p.Name = name for the same reason as Add.

Jump to

Keyboard shortcuts

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