Documentation ¶
Index ¶
- Constants
- type EventFilterOptions
- type ListRequest
- type ListResponse
- type Msg
- type RequesterAPIClient
- func (apiClient *RequesterAPIClient) Approve(ctx context.Context, jobID string, response bidstrategy.BidStrategyResponse) error
- 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, options EventFilterOptions) (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) Logs(ctx context.Context, jobID string, executionID string, withHistory bool, ...) (*websocket.Conn, error)
- func (apiClient *RequesterAPIClient) Submit(ctx context.Context, j *model.Job) (*model.Job, error)
- type RequesterAPIServer
- type RequesterAPIServerParams
Constants ¶
const ( APIPrefix = "requester/" ApprovalRoute = "approve" VerifyRoute = "verify" )
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 EventFilterOptions ¶ added in v0.3.26
type EventFilterOptions = jobstore.JobHistoryFilterOptions
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(host string, port uint16, path ...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) Approve ¶ added in v0.3.26
func (apiClient *RequesterAPIClient) Approve( ctx context.Context, jobID string, response bidstrategy.BidStrategyResponse, ) error
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, options EventFilterOptions) (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.
func (*RequesterAPIClient) Logs ¶ added in v0.3.26
func (apiClient *RequesterAPIClient) Logs( ctx context.Context, jobID string, executionID string, withHistory bool, follow bool) (*websocket.Conn, error)
Logs will retrieve the address of an endpoint where a client connection can be made to stream the results of an execution back to a TTY
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 }