nomad

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const JobPrefix = "OpenFaaS-"

JobPrefix contains a string that prefixes all OpenFaaS jobs

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployments

type Deployments interface {
	// List is used to dump all of the evaluations.
	List(q *api.QueryOptions) ([]*api.Deployment, *api.QueryMeta, error)
}

Deployments is an interface for the Nomad API

type Job

type Job interface {
	// Register creates a new Nomad job
	Register(*api.Job, *api.WriteOptions) (*api.JobRegisterResponse, *api.WriteMeta, error)
	Info(jobID string, q *api.QueryOptions) (*api.Job, *api.QueryMeta, error)
	List(q *api.QueryOptions) ([]*api.JobListStub, *api.QueryMeta, error)
	Deregister(jobID string, purge bool, q *api.WriteOptions) (string, *api.WriteMeta, error)
	Allocations(jobID string, allAllocs bool, q *api.QueryOptions) ([]*api.AllocationListStub, *api.QueryMeta, error)
}

Job defines the interface for creating a new new job

type MockDeployments

type MockDeployments struct {
	mock.Mock
}

func (*MockDeployments) List

type MockJob

type MockJob struct {
	mock.Mock
}

MockJob is a mock implementation of the Job interface

func (*MockJob) Allocations added in v0.2.25

func (m *MockJob) Allocations(jobID string, allAllocs bool, q *api.QueryOptions) ([]*api.AllocationListStub, *api.QueryMeta, error)

func (*MockJob) Deregister

func (m *MockJob) Deregister(jobID string, purge bool, q *api.WriteOptions) (
	string, *api.WriteMeta, error)

Deregister is a mock implementation of the interface method

func (*MockJob) Info

func (m *MockJob) Info(jobID string, q *api.QueryOptions) (*api.Job, *api.QueryMeta, error)

Info returns mock info from the job API

func (*MockJob) List

func (m *MockJob) List(q *api.QueryOptions) ([]*api.JobListStub, *api.QueryMeta, error)

List returns mock info from the job API

func (*MockJob) Register

func (m *MockJob) Register(job *api.Job, options *api.WriteOptions) (
	*api.JobRegisterResponse,
	*api.WriteMeta, error)

Register is a mock implementation of the register interface method

Jump to

Keyboard shortcuts

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