client

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package client implements the current runner management protocol. Its caller owns the SSH connection; ending an HTTP request never cancels accepted jobs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalid    = errors.New("invalid_remote_request")
	ErrIntegrity  = errors.New("remote_response_integrity_failed")
	ErrConnection = errors.New("remote_connection_failed")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(identity Identity, transport Transport) (*Client, error)

func (*Client) Command

func (client *Client) Command(
	ctx context.Context,
	command jobcontract.Command,
) (jobcontract.CommandConfirmation, error)

func (*Client) DownloadPerformanceArchive

func (client *Client) DownloadPerformanceArchive(
	ctx context.Context,
	jobID string,
	reference jobcontract.ReportReference,
	file io.ReadWriteSeeker,
) error

DownloadPerformanceArchive retrieves the statistical archive referenced by an EventReport. Full execution results use DownloadReport with their own digest.

func (*Client) DownloadReport

func (client *Client) DownloadReport(
	ctx context.Context,
	jobID string,
	reference jobcontract.ReportReference,
	file io.ReadWriteSeeker,
) error

DownloadReport resumes only against the supplied immutable reference. The caller owns its private partial file and publishes it only after nil return. Download time never changes metrics in the stored report.

func (*Client) GetJob

func (client *Client) GetJob(ctx context.Context, id string) (jobcontract.Snapshot, error)

func (*Client) ListJobs

func (client *Client) ListJobs(ctx context.Context, after uint64, limit uint32) (jobhost.JobPage, error)

func (*Client) Probe

func (client *Client) Probe(ctx context.Context) (jobcontract.RunnerInfo, error)

func (*Client) ReadEvents

func (client *Client) ReadEvents(ctx context.Context, query EventQuery) (jobhost.EventPage, error)

func (*Client) SetTaskConcurrency

func (client *Client) SetTaskConcurrency(
	ctx context.Context,
	expected uint32,
	limit uint32,
) (jobcontract.RunnerInfo, error)

func (*Client) Submit

func (client *Client) Submit(ctx context.Context, submission *jobcontract.Submission) (jobcontract.Receipt, error)

func (*Client) UploadContent

func (client *Client) UploadContent(
	ctx context.Context,
	identity jobcontract.ContentIdentity,
	source io.ReadCloser,
) (receipt jobcontract.AssetReceipt, err error)

UploadContent takes ownership of source on entry and closes it on every exit. source must support concurrent Close that promptly unblocks a pending Read. A lost acknowledgement is returned to the caller; retry requires a fresh, complete source for the same identity and never submits a job.

type EventQuery

type EventQuery struct {
	JobID         string
	AfterSequence uint64
	Limit         uint32
	Wait          time.Duration
}

type Identity

type Identity struct {
	NodeID         string
	InstallationID string
}

type RemoteError

type RemoteError struct {
	Code      string
	Retryable bool
}

RemoteError retains only a fixed public code and retry advice. Server message text and response bodies never become errors or diagnostics.

func (*RemoteError) Error

func (err *RemoteError) Error() string

type Transport

type Transport func(context.Context, remotessh.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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