Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // BaseDir is where tests will store state and can be overridden by // setting NOMAD_TEST_DIR. Defaults to "/opt/nomadtest" BaseDir = "/opt/nomadtest" )
Functions ¶
func NewClientServerPair ¶
func NewClientServerPair(bin string, serverOut, clientOut io.Writer) ( server *NomadAgent, client *NomadAgent, err error)
NewClientServerPair creates a pair of Nomad agents: 1 server, 1 client.
Types ¶
type AgentMode ¶
type AgentMode int
const ( // Conf enum is for configuring either a client, server, or mixed agent. ModeClient AgentMode = 1 ModeServer AgentMode = 2 ModeBoth = ModeClient | ModeServer )
type AgentTemplateVars ¶
type NomadAgent ¶
type NomadAgent struct { // BinPath is the path to the Nomad binary BinPath string // DataDir is the path state will be saved in DataDir string // ConfFile is the path to the agent's conf file ConfFile string // Cmd is the agent process Cmd *exec.Cmd // Vars are the config parameters used to template Vars *AgentTemplateVars }
NomadAgent manages an external Nomad agent process.
func NewMixedAgent ¶
func NewMixedAgent(bin string) (*NomadAgent, error)
NewMixedAgent creates a new Nomad agent in mixed server+client mode but does not start the agent process until the Start() method is called.
func (*NomadAgent) Client ¶
func (n *NomadAgent) Client() (*api.Client, error)
Client returns an api.Client for the agent.
func (*NomadAgent) Destroy ¶
func (n *NomadAgent) Destroy() error
Destroy stops the agent and removes the data dir.
func (*NomadAgent) Stop ¶
func (n *NomadAgent) Stop() error
Stop sends an interrupt signal and returns the command's Wait error.
Click to show internal directories.
Click to hide internal directories.