Documentation ¶
Index ¶
- Variables
- type Config
- type Context
- type Manager
- func (manager *Manager) AddProfile(profile Profile) error
- func (manager *Manager) CommandWithAPI(command *cobra.Command)
- func (manager *Manager) CommandWithGlobalOptions(command *cobra.Command)
- func (manager *Manager) GetProfile(name string) (*Profile, error)
- func (manager *Manager) HasProfile(name string) bool
- func (manager *Manager) Load()
- func (manager *Manager) RemoveProfile(name string) error
- func (manager *Manager) SafeSave() error
- func (manager *Manager) Save() error
- func (manager *Manager) SetDefaultProfile(name string) error
- func (manager *Manager) SetProfile(profile Profile)
- type NamedProfiles
- type Options
- type Profile
- type Settings
- type ShellCompletion
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MainManager = NewManager() Formats = []string{ "stylish", "json", "yaml", } FormatDescriptions = []string{ "stylish\tOutput format for human consumption", "json\tOutput in JSON", "yaml\tOutput in YAML", } ErrConfigExists = errors.New("configFile already exists") ErrUnknownProfile = errors.New("profile not found") ErrDuplicateProfile = errors.New("profile already exists") ErrConfigLoad = errors.New("unable to load config") ErrInvalidValue = errors.New("invalid value") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Debug bool `json:"debug" yaml:"debug"` OutputFormat string `json:"outputFormat,omitempty" yaml:"outputFormat,omitempty"` Timeout time.Duration `json:"timeout,omitempty" yaml:"timeout,omitempty"` DefaultProfile string `json:"defaultProfile,omitempty" yaml:"defaultProfile,omitempty"` Profiles NamedProfiles `json:"profiles,omitempty" yaml:"profiles,omitempty"` }
type Context ¶
type Context struct { Organization string `json:"organization,omitempty" yaml:"organization,omitempty"` Project string `json:"project,omitempty" yaml:"project,omitempty"` Environment string `json:"environment,omitempty" yaml:"environment,omitempty"` ServiceComponent string `json:"serviceComponent,omitempty" yaml:"serviceComponent,omitempty"` }
type Manager ¶
type Manager struct { Error error // contains filtered or unexported fields }
func NewManager ¶
func NewManager() *Manager
func (*Manager) AddProfile ¶
func (*Manager) CommandWithAPI ¶
func (*Manager) CommandWithGlobalOptions ¶
func (*Manager) HasProfile ¶
func (*Manager) RemoveProfile ¶
func (*Manager) SetDefaultProfile ¶
func (*Manager) SetProfile ¶
type NamedProfiles ¶
type Options ¶
type Options struct { // other options ConfigFile *option.String Verbosity *option.Count Timeout *option.Duration NoProgress *option.Bool NonInteractive *option.Bool // global options Debug *option.Bool OutputFormat *option.String ProfileName *option.String // profile options Host *option.String Scheme *option.String Token *option.String // Profile.Context options Organization *option.String Project *option.String Environment *option.String ServiceComponent *option.String }
func GetOptions ¶
func GetOptions() *Options
func NewOptions ¶
type Profile ¶
type Profile struct { Name string `json:"-" yaml:"-"` Host string `json:"host,omitempty" yaml:"host,omitempty"` Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"` Token string `json:"token,omitempty" yaml:"token,omitempty"` Context Context `json:"context,omitempty" yaml:"context,omitempty"` }
type Settings ¶
type Settings struct { ConfigFile string Debug bool NoProgress bool NonInteractive bool Profile Profile Verbosity int OutputFormat string Timeout time.Duration }
func GetSettings ¶
func GetSettings() *Settings
func NewSettings ¶
func NewSettings() *Settings
type ShellCompletion ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.