Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetJujuVersion ¶
GetJujuVersion gets the version of the agent from agent's config file
func ReadAgentConfig ¶
func ReadAgentConfig(c AgentConfigWriter, agentId string) error
ReadAgentConfig is a helper to read either machine or controller agent config, whichever is there. Machine config gets precedence.
Types ¶
type AgentConf ¶
type AgentConf interface {
// AddFlags injects common agent flags into f.
AddFlags(f *gnuflag.FlagSet)
// CheckArgs reports whether the given args are valid for this agent.
CheckArgs(args []string) error
// DataDir returns the directory where this agent should store its data.
DataDir() string
// ReadConfig reads the agent's config from its config file.
ReadConfig(tag string) error
// CurrentConfig returns the agent config for this agent.
CurrentConfig() agent.Config
// ChangeConfig modifies this configuration using the given mutator.
ChangeConfig(change agent.ConfigMutator) error
}
AgentConf is a terribly confused interface.
Parts of it are a mixin for cmd.Command implementations; others are a mixin for agent.Agent implementations; others bridge the two. We should be aiming to separate the cmd responsibilities from the agent responsibilities.
func NewAgentConf ¶
NewAgentConf returns a new value that satisfies AgentConf
type AgentConfigWriter ¶
type AgentConfigWriter interface {
// ReadConfig reads the config for the given tag from disk.
ReadConfig(tag string) error
// ChangeConfig executes the given agent.ConfigMutator in a
// thread-safe context.
ChangeConfig(agent.ConfigMutator) error
// CurrentConfig returns a copy of the in-memory agent config.
CurrentConfig() agent.Config
}
AgentConfigWriter encapsulates disk I/O operations with the agent config.
Click to show internal directories.
Click to hide internal directories.