nomad

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package nomad is an interface to nomad for retrieving tasks and launching parameterized jobs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*api.Client
}

A Client is a wrapper around a nomad API client which allows much more convenient methods to be built on top of it to provide information to the caller and simplify task dispatch.

func New

func New() (*Client, error)

func (*Client) Dispatch

func (c *Client) Dispatch(name string, kv map[string]string) error

Dispatch can be used to dispatch a parameterized task.

func (*Client) ListTasks

func (c *Client) ListTasks(cfg QueryOpts) ([]Task, error)

ListTasks crawls nomad for running tasks. This can include batch tasks, service tasks, system tasks, and any other kind of task as long as it is running.

type QueryOpts

type QueryOpts struct {
	Region    string
	Namespace string
	Prefix    string
}

type Task

type Task struct {
	Job    string
	Group  string
	Name   string
	Driver string
	URL    string
	Docker docker.Image
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL