profiles

package
v0.0.0-...-f23cdb6 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCurrentProfile = errors.New("No current profile is set, run 'sdpctl profile set'")
View Source
var ErrNoProfileAvailable = errors.New("No profiles are available. run 'sdpctl profile set'")

Functions

func ConfigDirectoryExists

func ConfigDirectoryExists() bool

func CreateAllDirectories

func CreateAllDirectories() error

func CreateConfigDirectory

func CreateConfigDirectory() error

func CreateLogDirectory

func CreateLogDirectory() error

func Directories

func Directories() (string, string)

func FileExists

func FileExists() bool

func FilePath

func FilePath() string

func GetConfigDirectory

func GetConfigDirectory() string

func GetConfigPath

func GetConfigPath() string

func GetCurrentProfile

func GetCurrentProfile() string

func GetDataDirectory

func GetDataDirectory() string

func GetLogPath

func GetLogPath() string

func LogDirectoryExists

func LogDirectoryExists() bool

func Write

func Write(p *Profiles) error

Types

type Profile

type Profile struct {
	Directory string `json:"directory"`
	LogPath   string `json:"logs"`
	Name      string `json:"name"`
}

func (*Profile) GetConfigurationPath

func (p *Profile) GetConfigurationPath() string

func (*Profile) GetLogPath

func (p *Profile) GetLogPath() string

type Profiles

type Profiles struct {
	Current *string   `json:"current,omitempty"`
	List    []Profile `json:"list,omitempty"`
}
var ReadProfiles *Profiles

func Read

func Read() (*Profiles, error)

func (*Profiles) Available

func (p *Profiles) Available() []string

func (*Profiles) CreateDefaultProfile

func (p *Profiles) CreateDefaultProfile() (*Profile, error)

func (*Profiles) CurrentConfigExists

func (p *Profiles) CurrentConfigExists() bool

func (*Profiles) CurrentExists

func (p *Profiles) CurrentExists() bool

func (*Profiles) CurrentProfile

func (p *Profiles) CurrentProfile() (*Profile, error)

func (*Profiles) GetProfile

func (p *Profiles) GetProfile(name string) (*Profile, error)

Jump to

Keyboard shortcuts

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