Documentation ¶
Index ¶
- type Nomad
- type NomadImpl
- func (n *NomadImpl) Create(files []string) error
- func (n *NomadImpl) Endpoints(job, group, task string) ([]map[string]string, error)
- func (n *NomadImpl) HealthCheckAPI(timeout time.Duration) error
- func (n *NomadImpl) JobRunning(job string) (bool, error)
- func (n *NomadImpl) ParseJob(file string) ([]byte, error)
- func (n *NomadImpl) SetConfig(address string, port, nodes int) error
- func (n *NomadImpl) Stop(files []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Nomad ¶
type Nomad interface { // SetConfig for the client, path is a valid Nomad JSON config file SetConfig(address string, port, nodes int) error // Create jobs in the provided files Create(files []string) error // Stop jobs in the provided files Stop(files []string) error // ParseJob in the given file and return a JSON blob representing the HCL job ParseJob(file string) ([]byte, error) // JobRunning returns true if all allocations for a job are running JobRunning(job string) (bool, error) // HealthCheckAPI uses the Nomad API to check that all servers and nodes // are ready. The function will block until either all nodes are healthy or the // timeout period elapses. HealthCheckAPI(time.Duration) error // Endpoints returns a list of endpoints for a cluster Endpoints(job, group, task string) ([]map[string]string, error) }
Nomad defines an interface for a Nomad client
type NomadImpl ¶
type NomadImpl struct {
// contains filtered or unexported fields
}
NomadImpl is an implementation of the Nomad interface
func (*NomadImpl) Create ¶
Create jobs in the Nomad cluster for the given files and wait until all jobs are running
func (*NomadImpl) HealthCheckAPI ¶
HealthCheckAPI executes a HTTP heath check for a Nomad cluster
func (*NomadImpl) JobRunning ¶
JobRunning returns true when all allocations for a job are running
func (*NomadImpl) ParseJob ¶
ParseJob validates a HCL job file with the Nomad API and returns a slice of bytes representing the JSON payload.
Click to show internal directories.
Click to hide internal directories.