Documentation
¶
Index ¶
- Variables
- type Config
- func (c *Config) Context(name string) (*Context, error)
- func (c *Config) DeleteContext(name string)
- func (c *Config) DeleteHost(key string)
- func (c *Config) Host(key string) (*Host, error)
- func (c *Config) Path() string
- func (c *Config) Save() error
- func (c *Config) SetActiveContext(name string) error
- func (c *Config) SetContext(name string, ctx *Context)
- func (c *Config) SetHost(key string, host *Host)
- type Context
- type Host
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrContextNotFound = errors.New("context not found") ErrHostNotFound = errors.New("host not found") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Version int `yaml:"version"`
ActiveContext string `yaml:"active_context,omitempty"`
Contexts map[string]*Context `yaml:"contexts,omitempty"`
Hosts map[string]*Host `yaml:"hosts,omitempty"`
// contains filtered or unexported fields
}
func (*Config) DeleteContext ¶
func (*Config) DeleteHost ¶
func (*Config) SetActiveContext ¶
func (*Config) SetContext ¶
type Host ¶
type Host struct {
BaseURL string `yaml:"base_url"`
StoreCode string `yaml:"store_code,omitempty"`
Token string `yaml:"token,omitempty"`
AllowInsecureStore bool `yaml:"allow_insecure_store,omitempty"`
}
func (*Host) MarshalYAML ¶
MarshalYAML strips the token field so credentials are never written to disk.
Click to show internal directories.
Click to hide internal directories.