profiles

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProfilesPathForApp

func GetProfilesPathForApp(appName string) (string, error)

GetProfilesPathForApp returns the default path for the profiles YAML file for a given application name. It typically uses ~/.config/<appName>/profiles.yaml.

func NewProfilesCommand

func NewProfilesCommand(appName string, initialContentProvider InitialContentProvider) (*cobra.Command, error)

NewProfilesCommand creates the "profiles" command group for managing application profiles. It requires the application name (used for the config directory) and a function to provide the initial content for a new profiles file.

Types

type InitialContentProvider

type InitialContentProvider func() string

InitialContentProvider is a function type that returns the default content for a new profiles file.

type LayerName

type LayerName = string

type ProfileName

type ProfileName = string

type ProfilesEditor

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

func NewProfilesEditor

func NewProfilesEditor(path string) (*ProfilesEditor, error)

func (*ProfilesEditor) DeleteLayer

func (p *ProfilesEditor) DeleteLayer(profile, layer string) error

func (*ProfilesEditor) DeleteLayerValue

func (p *ProfilesEditor) DeleteLayerValue(profile, layer, key string) error

func (*ProfilesEditor) DeleteProfile

func (p *ProfilesEditor) DeleteProfile(profile string) error

func (*ProfilesEditor) DuplicateProfile

func (p *ProfilesEditor) DuplicateProfile(sourceProfile, newProfile string) error

DuplicateProfile copies an existing profile to a new name.

func (*ProfilesEditor) GetLayerValue

func (p *ProfilesEditor) GetLayerValue(profile, layer, key string) (string, error)

func (*ProfilesEditor) GetProfileLayers

func (p *ProfilesEditor) GetProfileLayers(profile ProfileName) (ProfileLayers, error)

GetProfileLayers returns the layers for a specific profile as an ordered map.

func (*ProfilesEditor) ListProfiles

func (p *ProfilesEditor) ListProfiles() ([]ProfileName, map[ProfileName]map[LayerName]map[SettingName]SettingValue, error)

ListProfiles returns the names of all profiles and their full content.

func (*ProfilesEditor) Save

func (p *ProfilesEditor) Save() error

func (*ProfilesEditor) SetLayerValue

func (p *ProfilesEditor) SetLayerValue(profile, layer, key, value string) error

type SettingName

type SettingName = string

type SettingValue

type SettingValue = string

Jump to

Keyboard shortcuts

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