Documentation
¶
Index ¶
- Constants
- func IsConnectionErr(err error) bool
- type Client
- func (n *Client) LogJobs(ctx context.Context, follow bool, origin string, offset int64, jobIDs []string) (io.ReadCloser, error)
- func (n *Client) Run(job *api.Job) (bool, error)
- func (n *Client) RunAndWait(ctx context.Context, job api.Job) error
- func (n *Client) Stop(ctx context.Context, jobID string, purge bool) (bool, error)
- type ConnectionError
- type FrameReader
- type JobRunner
- func (r *JobRunner) RunNodeSets(ctx context.Context, nodeSets []types.NodeSet) ([]api.Job, error)
- func (r *JobRunner) StartNetwork(gCtx context.Context, conf *config.Config, ...) (*types.NetworkJobs, error)
- func (r *JobRunner) StopJobs(ctx context.Context, jobIDs []string) error
- func (r *JobRunner) StopNetwork(ctx context.Context, jobs *types.NetworkJobs, nodesOnly bool) error
- type StreamFrame
Constants ¶
View Source
const ( DeploymentStatusRunning = "running" DeploymentStatusCanceled = "canceled" DeploymentStatusSuccess = "successful" AllocationStateDead = "dead" Running = "running" )
Variables ¶
This section is empty.
Functions ¶
func IsConnectionErr ¶
Types ¶
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 {
// contains filtered or unexported fields
}
func NewJobRunner ¶
func (*JobRunner) RunNodeSets ¶
func (*JobRunner) StartNetwork ¶
func (r *JobRunner) StartNetwork(gCtx context.Context, conf *config.Config, generatedSvcs *types.GeneratedServices) (*types.NetworkJobs, error)
func (*JobRunner) StopNetwork ¶
type StreamFrame ¶
type StreamFrame struct { Name string *api.StreamFrame }
Click to show internal directories.
Click to hide internal directories.