Documentation ¶
Index ¶
- type Client
- func (c *Client) Checker(ctx context.Context, check *health.CheckState) error
- func (c *Client) GetImportJob(ctx context.Context, importJobID, serviceToken string) (importJob ImportJob, err error)
- func (c *Client) IncreaseProcessedInstanceCount(ctx context.Context, jobID, serviceToken, instanceID string) (procInst []ProcessedInstances, err error)
- func (c *Client) UpdateImportJobState(ctx context.Context, jobID, serviceToken string, newState string) error
- type ErrInvalidAPIResponse
- type ImportJob
- type InstanceLink
- type LinkMap
- type ProcessedInstances
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an import api client which can be used to make requests to the API
func (*Client) Checker ¶
Checker calls import api health endpoint and returns a check object to the caller.
func (*Client) GetImportJob ¶
func (c *Client) GetImportJob(ctx context.Context, importJobID, serviceToken string) (importJob ImportJob, err error)
GetImportJob asks the Import API for the details for an Import job
func (*Client) IncreaseProcessedInstanceCount ¶
type ErrInvalidAPIResponse ¶
type ErrInvalidAPIResponse struct {
// contains filtered or unexported fields
}
ErrInvalidAPIResponse is returned when the api does not respond with a valid status
func NewAPIResponse ¶
func NewAPIResponse(resp *http.Response, uri string) (e *ErrInvalidAPIResponse)
NewAPIResponse creates an error response, optionally adding body to e when status is 404
func (ErrInvalidAPIResponse) Code ¶
func (e ErrInvalidAPIResponse) Code() int
Code returns the status code received from the api if an error is returned
func (ErrInvalidAPIResponse) Error ¶
func (e ErrInvalidAPIResponse) Error() string
Error should be called by the user to print out the stringified version of the error
type ImportJob ¶
type ImportJob struct { JobID string `json:"id"` Links LinkMap `json:"links,omitempty"` Processed []ProcessedInstances `json:"processed_instances,omitempty"` }
ImportJob comes from the Import API and links an import job to its (other) instances
type InstanceLink ¶
InstanceLink identifies an (instance or import-job) by id and url (from Import API)
type LinkMap ¶
type LinkMap struct {
Instances []InstanceLink `json:"instances"`
}
LinkMap is an array of instance links associated with am import job
type ProcessedInstances ¶
type ProcessedInstances struct { ID string `json:"id,omitempty"` RequiredCount int `json:"required_count,omitempty"` ProcessedCount int `json:"processed_count,omitempty"` }
ProcessedInstances holds the ID and the number of code lists that have been processed during an import process for an instance