Documentation
¶
Index ¶
- Variables
- func ConfigDir() string
- func ShellCompName(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- type ActiveStatus
- type GetActiveFilter
- type Profile
- func (p Profile) ActivateGlobally(force bool) error
- func (p Profile) ActivateLocally(force bool) error
- func (p Profile) ConfigPath() string
- func (p Profile) Create() error
- func (p Profile) Exists() bool
- func (p Profile) HostsPath() string
- func (p Profile) IsActiveGlobally() bool
- func (p Profile) IsActiveLocally() bool
- func (p Profile) Path() string
- func (p Profile) Remove() error
- func (p Profile) Rename(to string) error
- func (p Profile) Status() ActiveStatus
- func (p Profile) WritePrevious() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPreviousNotSet = errors.New("previous profile not set") ErrPreviousNotExist = errors.New("previous profile does not exist") )
View Source
var ( ErrExist = errors.New("profile already exists") ErrNotExist = errors.New("profile does not exist") ErrActive = errors.New("profile already active") ErrNameUnchanged = errors.New("name unchanged") ConfigDirName = "profiles" )
View Source
var ErrNoActive = errors.New("no profile is active")
View Source
var ErrNoneFound = errors.New("no profiles found")
View Source
var ErrUnknownProfile = errors.New("unknown profile")
Functions ¶
func ShellCompName ¶ added in v1.3.2
Types ¶
type ActiveStatus ¶ added in v1.2.0
func (ActiveStatus) IsActive ¶ added in v1.2.0
func (s ActiveStatus) IsActive() bool
func (ActiveStatus) IsAnyActive ¶ added in v1.2.0
func (s ActiveStatus) IsAnyActive() bool
type GetActiveFilter ¶ added in v1.3.0
type GetActiveFilter uint8
const ( GetActiveDynamic GetActiveFilter = iota GetActiveGlobal GetActiveLocal )
type Profile ¶
type Profile struct {
Name string
}
func GetActive ¶ added in v1.3.0
func GetActive(filters ...GetActiveFilter) (Profile, error)
func GetPrevious ¶ added in v1.3.0
func (Profile) ActivateGlobally ¶ added in v1.2.0
func (Profile) ActivateLocally ¶ added in v1.2.0
func (Profile) ConfigPath ¶ added in v1.2.0
func (Profile) IsActiveGlobally ¶ added in v1.2.0
func (Profile) IsActiveLocally ¶ added in v1.2.0
func (Profile) Status ¶ added in v1.2.0
func (p Profile) Status() ActiveStatus
func (Profile) WritePrevious ¶ added in v1.3.0
Click to show internal directories.
Click to hide internal directories.