Documentation
¶
Overview ¶
Package jobsqueueapi contains request definitions for the Jobs Queue API. Requests can be sent by any HTTP client that implements the client.Sender interface. It is necessary to set API host in the HTTP client, see the ClientWithHost function.
Index ¶
- func ClientWithHostAndToken(c client.Client, apiHost string, apiToken string) client.Client
- func CreateJobConfigDataRequest(componentID ComponentID, configId ConfigID, configData map[string]any) client.APIRequest[*Job]
- func CreateJobRequest(componentID ComponentID, configID ConfigID) client.APIRequest[*Job]
- func GetJobRequest(key JobKey) client.APIRequest[*Job]
- func WaitForJob(ctx context.Context, sender client.Sender, job *Job) error
- type ComponentID
- type ConfigID
- type Error
- type Job
- type JobID
- type JobKey
- type JobResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientWithHostAndToken ¶
ClientWithHostAndToken returns HTTP client with api host and token set.
func CreateJobConfigDataRequest ¶ added in v0.5.0
func CreateJobConfigDataRequest(componentID ComponentID, configId ConfigID, configData map[string]any) client.APIRequest[*Job]
CreateJobConfigDataRequest - https://app.swaggerhub.com/apis-docs/keboola/job-queue-api/1.3.2#/Jobs/createJob
Allows setting configData.
`configId` can be set to an empty string and it will be omitted.
func CreateJobRequest ¶
func CreateJobRequest(componentID ComponentID, configID ConfigID) client.APIRequest[*Job]
CreateJobRequest - https://app.swaggerhub.com/apis-docs/keboola/job-queue-api/1.3.2#/Jobs/createJob
func GetJobRequest ¶
func GetJobRequest(key JobKey) client.APIRequest[*Job]
GetJobRequest https://app.swaggerhub.com/apis-docs/keboola/job-queue-api/1.3.2#/Jobs/getJob
Types ¶
type ComponentID ¶
type ComponentID = storageapi.ComponentID
ComponentID is id of a Keboola component.
type ConfigID ¶
type ConfigID = storageapi.ConfigID
ConfigID is id of a Keboola component configuration.
type Error ¶
type Error struct { Message string `json:"error"` ErrCode int `json:"code"` ExceptionID string `json:"exceptionId"` // contains filtered or unexported fields }
Error represents the structure of Jobs Queue API error.
func (Error) ErrorExceptionID ¶
ErrorExceptionID returns exception ID to find details in logs.
func (Error) ErrorUserMessage ¶
ErrorUserMessage returns error message for end user.
func (*Error) SetRequest ¶
SetRequest method allows injection of HTTP request to the error, it implements client.errorWithRequest.
func (*Error) SetResponse ¶
SetResponse method allows injection of HTTP response to the error, it implements client.errorWithResponse.
type Job ¶
type Job struct { JobKey Status string `json:"status"` IsFinished bool `json:"isFinished"` URL string `json:"url"` Result JobResult `json:"result,omitempty"` CreateTime iso8601.Time `json:"createdTime"` StartTime *iso8601.Time `json:"startTime"` EndTime *iso8601.Time `json:"endTime"` }
Job is a component job.