Documentation ¶
Index ¶
- Constants
- func GetJobPorts(job *api.Job) []int64
- func IsConnectionErr(err error) bool
- func IsJobTimeoutErr(err error) bool
- type Client
- func (n *Client) Info(ctx context.Context, jobID string) (*api.Job, error)
- func (n *Client) JobRunning(ctx context.Context, jobID string) bool
- func (n *Client) List(ctx context.Context) ([]*api.JobListStub, error)
- func (n *Client) LogJobs(ctx context.Context, follow bool, origin string, offset int64, jobIDs []string) (io.ReadCloser, error)
- func (n *Client) Run(ctx context.Context, job *api.Job) (bool, error)
- func (n *Client) RunAndWait(ctx context.Context, job *api.Job, probe *types.ProbesConfig) error
- func (n *Client) Stop(ctx context.Context, jobID string, purge bool) error
- type ConnectionError
- type FrameReader
- type JobRunner
- func (r *JobRunner) ListExposedPorts(ctx context.Context) (map[string][]int64, error)
- func (r *JobRunner) ListExposedPortsPerJob(ctx context.Context, jobID string) ([]int64, error)
- func (r *JobRunner) RunDockerJob(ctx context.Context, dc config.DockerConfig) (string, error)
- func (r *JobRunner) RunExecJob(ctx context.Context, ec config.ExecConfig) (string, error)
- func (r *JobRunner) RunNodeSets(ctx context.Context, nodeSets []types.NodeSet, stopOnFailure bool) ([]*api.Job, error)
- func (r *JobRunner) RunRawNomadJobs(ctx context.Context, rawJobs []string) ([]types.RawJobWithNomadJob, error)
- func (r *JobRunner) StartFaucet(ctx context.Context, faucetConfig *config.FaucetConfig, ...) (string, error)
- func (r *JobRunner) StartNetwork(ctx context.Context, conf *config.Config, ...) (*types.NetworkJobs, error)
- func (r *JobRunner) StartWallet(ctx context.Context, walletConfig *config.WalletConfig, ...) (string, error)
- func (r *JobRunner) StopJobs(ctx context.Context, jobIDs []string) ([]string, error)
- func (r *JobRunner) StopNetwork(ctx context.Context, jobs *types.NetworkJobs, nodesOnly bool) ([]string, error)
- type JobTimeoutError
- type StreamFrame
- type VoidJobRunner
Constants ¶
const ( DeploymentStatusRunning = "running" DeploymentStatusCanceled = "cancelled" DeploymentStatusSuccess = "successful" AllocationStateDead = "dead" Running = "running" Dead = "dead" Pending = "pending" Terminated = "terminated" )
Variables ¶
This section is empty.
Functions ¶
func GetJobPorts ¶ added in v0.2.3
func IsConnectionErr ¶
func IsJobTimeoutErr ¶ added in v0.3.0
Types ¶
type Client ¶
func (*Client) JobRunning ¶ added in v0.3.0
func (*Client) List ¶ added in v0.2.3
List returns all the jobs wrapped in the slice of the `api.JobListStub` structs
func (*Client) RunAndWait ¶
type ConnectionError ¶
type ConnectionError struct {
Err error
}
func (*ConnectionError) Error ¶
func (ce *ConnectionError) Error() string
type FrameReader ¶
type FrameReader struct {
// contains filtered or unexported fields
}
FrameReader is used to convert a stream of frames into a read closer.
func NewFrameReader ¶
func NewFrameReader(frames <-chan *StreamFrame, errCh <-chan error, cancelCh chan struct{}) *FrameReader
NewFrameReader takes a channel of frames and returns a FrameReader which implements io.ReadCloser
func (*FrameReader) Read ¶
func (f *FrameReader) Read(p []byte) (n int, err error)
Read reads the data of the incoming frames into the bytes buffer. Returns EOF when there are no more frames.
func (*FrameReader) SetUnblockTime ¶
func (f *FrameReader) SetUnblockTime(d time.Duration)
SetUnblockTime sets the time to unblock and return zero bytes read. If the duration is unset or is zero or less, the read will block until data is read.
type JobRunner ¶
type JobRunner struct { Client *Client // contains filtered or unexported fields }
func NewJobRunner ¶
func (*JobRunner) ListExposedPorts ¶ added in v0.2.3
ListExposedPorts returns exposed ports across all nodes
func (*JobRunner) ListExposedPortsPerJob ¶ added in v0.2.3
ListExposedPortsPerJob returns exposed ports per node
func (*JobRunner) RunDockerJob ¶ added in v0.69.0
func (*JobRunner) RunExecJob ¶ added in v0.69.0
func (*JobRunner) RunNodeSets ¶
func (r *JobRunner) RunNodeSets(ctx context.Context, nodeSets []types.NodeSet, stopOnFailure bool) ([]*api.Job, error)
RunNodeSets returns list of started jobs. When one of the jobs fails during startup it returns jobs that has alredy started before that.
func (*JobRunner) RunRawNomadJobs ¶ added in v0.2.0
func (*JobRunner) StartFaucet ¶ added in v0.69.0
func (*JobRunner) StartNetwork ¶
func (*JobRunner) StartWallet ¶ added in v0.69.0
func (*JobRunner) StopNetwork ¶
type JobTimeoutError ¶ added in v0.2.3
type JobTimeoutError struct {
JobID string
}
func (*JobTimeoutError) Error ¶ added in v0.2.3
func (ce *JobTimeoutError) Error() string
type StreamFrame ¶
type StreamFrame struct { Name string *api.StreamFrame }
type VoidJobRunner ¶ added in v0.2.0
type VoidJobRunner struct{}
func NewVoidJobRunner ¶ added in v0.2.0
func NewVoidJobRunner() *VoidJobRunner
func (*VoidJobRunner) GetJobPorts ¶ added in v0.2.3
func (r *VoidJobRunner) GetJobPorts(job *api.Job) []int64
func (*VoidJobRunner) RunRawNomadJobs ¶ added in v0.2.0
func (r *VoidJobRunner) RunRawNomadJobs(ctx context.Context, rawJobs []string) ([]types.RawJobWithNomadJob, error)
func (*VoidJobRunner) StopNetwork ¶ added in v0.2.0
func (r *VoidJobRunner) StopNetwork(ctx context.Context, jobs *types.NetworkJobs, nodesOnly bool) ([]string, error)