Documentation
¶
Overview ¶
Package remote is the daemons the CLI knows, kept with the current one in ~/.config/dicer/remotes.yaml, and how each is reached.
Index ¶
- Constants
- func ConfigDir() (string, error)
- func IsAddress(s string) bool
- type Config
- func (c *Config) Create(name string, r Remote) error
- func (c *Config) CurrentName() string
- func (c *Config) Delete(name string) error
- func (c *Config) Names() []string
- func (c *Config) Remote(name string) (Remote, error)
- func (c *Config) Save(dir string) error
- func (c *Config) Use(name string) error
- type Remote
Constants ¶
View Source
const ( // ConfigDirEnv is the environment variable that overrides the // configuration directory. ConfigDirEnv = "DICER_CONFIG_DIR" )
View Source
const ( // Local names the built-in remote: the daemon on this machine, on its // default socket. It is always there and cannot be deleted. Local = "local" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Current is the remote commands go to unless told otherwise. Empty
// means the local one.
Current string `yaml:"current,omitempty"`
// Remotes are the configured remotes by name, the built-in one aside.
Remotes map[string]Remote `yaml:"remotes,omitempty"`
}
Config is the set of remotes, as kept in remotes.yaml.
func (*Config) CurrentName ¶
CurrentName returns the name of the current remote.
func (*Config) Delete ¶
Delete removes a remote. Deleting the current one makes the local one current.
type Remote ¶
type Remote struct {
// Address is a gRPC target: unix:///path/to/socket, or HOST:PORT for a
// daemon's TCP listener.
Address string `yaml:"address"`
// Token is what every call to a TCP address is made with, which also
// says how the daemon is checked. A socket takes none.
Token string `yaml:"token,omitempty"`
}
Remote is a daemon the CLI talks to: on its socket, or on its TCP listener with a token.
func (Remote) ClientOptions ¶
ClientOptions returns what dicer.NewClient needs to reach the remote.
Click to show internal directories.
Click to hide internal directories.