Documentation
¶
Index ¶
- Constants
- type ContainsClientID
- type JobApprovePayload
- type ListRequest
- type ListResponse
- type RequesterAPIClient
- func (apiClient *RequesterAPIClient) Cancel(ctx context.Context, jobID string, reason string) (*model.JobState, error)
- func (apiClient *RequesterAPIClient) Debug(ctx context.Context) (map[string]model.DebugInfo, error)
- func (apiClient *RequesterAPIClient) Get(ctx context.Context, jobID string) (*model.JobWithInfo, bool, error)
- func (apiClient *RequesterAPIClient) GetEvents(ctx context.Context, jobID string) (events []model.JobHistory, err error)
- func (apiClient *RequesterAPIClient) GetJobState(ctx context.Context, jobID string) (model.JobState, error)
- func (apiClient *RequesterAPIClient) GetJobStateResolver() *job.StateResolver
- func (apiClient *RequesterAPIClient) GetResults(ctx context.Context, jobID string) (results []model.PublishedResult, err error)
- func (apiClient *RequesterAPIClient) List(ctx context.Context, idFilter string, includeTags []model.IncludedTag, ...) ([]*model.JobWithInfo, error)
- func (apiClient *RequesterAPIClient) Submit(ctx context.Context, j *model.Job) (*model.Job, error)
- type RequesterAPIServer
- type RequesterAPIServerParams
- type SignedRequest
Constants ¶
const APIPrefix = "requester/"
const APIRetryCount = 5
APIRetryCount - for some queries (like read events and read state) we want to fail early (10 seconds should be ample time) but retry a number of times - this is to avoid network flakes failing the canary
const APIShortTimeoutSeconds = 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainsClientID ¶ added in v0.3.24
type ContainsClientID interface {
GetClientID() string
}
type JobApprovePayload ¶ added in v0.3.24
type JobApprovePayload struct {
requester.ApproveJobRequest
}
func (JobApprovePayload) GetClientID ¶ added in v0.3.24
func (j JobApprovePayload) GetClientID() string
type ListRequest ¶
type ListRequest = listRequest
type ListResponse ¶
type ListResponse = listResponse
type RequesterAPIClient ¶
RequesterAPIClient is a utility for interacting with a node's API server.
func NewRequesterAPIClient ¶
func NewRequesterAPIClient(baseURI string) *RequesterAPIClient
NewRequesterAPIClient returns a new client for a node's API server.
func NewRequesterAPIClientFromClient ¶
func NewRequesterAPIClientFromClient(baseClient *publicapi.APIClient) *RequesterAPIClient
NewRequesterAPIClientFromClient returns a new client for a node's API server.
func (*RequesterAPIClient) Cancel ¶
func (apiClient *RequesterAPIClient) Cancel(ctx context.Context, jobID string, reason string) (*model.JobState, error)
Cancel will request that the job with the specified ID is stopped. The JobInfo will be returned if the cancel was submitted. If no match is found, Cancel returns false with a nil error.
func (*RequesterAPIClient) Get ¶
func (apiClient *RequesterAPIClient) Get(ctx context.Context, jobID string) (*model.JobWithInfo, bool, error)
Get returns job data for a particular job ID. If no match is found, Get returns false with a nil error.
func (*RequesterAPIClient) GetEvents ¶
func (apiClient *RequesterAPIClient) GetEvents(ctx context.Context, jobID string) (events []model.JobHistory, err error)
func (*RequesterAPIClient) GetJobState ¶
func (*RequesterAPIClient) GetJobStateResolver ¶
func (apiClient *RequesterAPIClient) GetJobStateResolver() *job.StateResolver
func (*RequesterAPIClient) GetResults ¶
func (apiClient *RequesterAPIClient) GetResults(ctx context.Context, jobID string) (results []model.PublishedResult, err error)
func (*RequesterAPIClient) List ¶
func (apiClient *RequesterAPIClient) List( ctx context.Context, idFilter string, includeTags []model.IncludedTag, excludeTags []model.ExcludedTag, maxJobs int, returnAll bool, sortBy string, sortReverse bool, ) ( []*model.JobWithInfo, error)
List returns the list of jobs in the node's transport.
type RequesterAPIServer ¶
type RequesterAPIServer struct {
// contains filtered or unexported fields
}
func NewRequesterAPIServer ¶
func NewRequesterAPIServer(params RequesterAPIServerParams) *RequesterAPIServer
func (*RequesterAPIServer) HandleJobEvent ¶
func (*RequesterAPIServer) RegisterAllHandlers ¶
func (s *RequesterAPIServer) RegisterAllHandlers() error
type RequesterAPIServerParams ¶
type RequesterAPIServerParams struct { APIServer *publicapi.APIServer Requester requester.Endpoint DebugInfoProviders []model.DebugInfoProvider JobStore jobstore.Store StorageProviders storage.StorageProvider }
type SignedRequest ¶ added in v0.3.24
type SignedRequest[PayloadType ContainsClientID] struct { // The data needed to cancel a running job on the network Payload PayloadType `json:"payload" validate:"required"` // A base64-encoded signature of the data, signed by the client: ClientSignature string `json:"signature" validate:"required"` // The base64-encoded public key of the client: ClientPublicKey string `json:"client_public_key" validate:"required"` }
A strongly-typed signed request. We use this type only in our documentation to allow clients to understand the correct type of the payload.