Documentation ¶
Index ¶
- Variables
- type Config
- func (c *Config) ConfigPath(paths ...string) string
- func (c *Config) GenerateClientCertificate() error
- func (c *Config) GetContainerServer(name string) (lxd.ContainerServer, error)
- func (c *Config) GetImageServer(name string) (lxd.ImageServer, error)
- func (c *Config) HasClientCertificate() bool
- func (c *Config) ParseRemote(raw string) (string, string, error)
- func (c *Config) SaveConfig(path string) error
- func (c *Config) SaveCookies()
- func (c *Config) ServerCertPath(remote string) string
- func (c *Config) SetAuthInteractor(interactor httpbakery.Interactor)
- type Remote
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{ Remotes: DefaultRemotes, DefaultRemote: "local", }
DefaultConfig is the default configuration
var DefaultRemotes = map[string]Remote{ "images": ImagesRemote, "local": LocalRemote, "ubuntu": UbuntuRemote, "ubuntu-daily": UbuntuDailyRemote, }
DefaultRemotes is the list of default remotes
var ImagesRemote = Remote{ Addr: "https://images.linuxcontainers.org", Public: true, Protocol: "simplestreams", }
ImagesRemote is the community image server (over simplestreams)
var LocalRemote = Remote{ Addr: "unix://", Static: true, Public: false, }
LocalRemote is the default local remote (over the LXD unix socket)
var StaticRemotes = map[string]Remote{ "local": LocalRemote, "ubuntu": UbuntuRemote, "ubuntu-daily": UbuntuDailyRemote, }
StaticRemotes is the list of remotes which can't be removed
var UbuntuDailyRemote = Remote{ Addr: "https://cloud-images.ubuntu.com/daily", Static: true, Public: true, Protocol: "simplestreams", }
UbuntuDailyRemote is the Ubuntu daily image server (over simplestreams)
var UbuntuRemote = Remote{ Addr: "https://cloud-images.ubuntu.com/releases", Static: true, Public: true, Protocol: "simplestreams", }
UbuntuRemote is the Ubuntu image server (over simplestreams)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // DefaultRemote holds the remote daemon name from the Remotes map // that the client should communicate with by default DefaultRemote string `yaml:"default-remote"` // Remotes defines a map of remote daemon names to the details for // communication with the named daemon Remotes map[string]Remote `yaml:"remotes"` // Command line aliases for `lxc` Aliases map[string]string `yaml:"aliases"` // Configuration directory ConfigDir string `yaml:"-"` // The UserAgent to pass for all queries UserAgent string `yaml:"-"` // contains filtered or unexported fields }
Config holds settings to be used by a client or daemon
func LoadConfig ¶
LoadConfig reads the configuration from the config path; if the path does not exist, it returns a default configuration.
func (*Config) ConfigPath ¶
ConfigPath returns a joined path of the configuration directory and passed arguments
func (*Config) GenerateClientCertificate ¶
GenerateClientCertificate will generate the needed client.crt and client.key if needed
func (*Config) GetContainerServer ¶
GetContainerServer returns a ContainerServer struct for the remote
func (*Config) GetImageServer ¶
GetImageServer returns a ImageServer struct for the remote
func (*Config) HasClientCertificate ¶
HasClientCertificate will return true if a client certificate has already been generated
func (*Config) ParseRemote ¶
ParseRemote splits remote and object
func (*Config) SaveConfig ¶
SaveConfig writes the provided configuration to the config file.
func (*Config) ServerCertPath ¶
ServerCertPath returns the path for the remote's server certificate
func (*Config) SetAuthInteractor ¶
func (c *Config) SetAuthInteractor(interactor httpbakery.Interactor)
SetAuthInteractor sets the interactor for macaroon-based authorization