Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrGetRecipeFailed = errors.New("failed to get recipe") ErrSaveJobFailed = errors.New("failed to save job") )
A list of custom errors
Functions ¶
func ErrCreateInstanceFailed ¶
ErrCreateInstanceFailed builds the message for an error when creating an instance
Types ¶
type DatasetAPIClient ¶ added in v1.15.0
type DatasetAPIClient interface { PostInstance(ctx context.Context, serviceAuthToken string, newInstance *dataset.NewInstance) (*dataset.Instance, error) PutInstance(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, instanceID string, instanceUpdate dataset.UpdateInstance) error Checker(ctx context.Context, state *healthcheck.CheckState) error }
DatasetAPIClient interface to the dataset API.
type Queue ¶
type Queue interface {
Queue(ctx context.Context, job *models.ImportData) error
}
Queue interface used to queue import jobs.
type RecipeAPIClient ¶ added in v1.15.0
type RecipeAPIClient interface { GetRecipe(ctx context.Context, userAuthToken, serviceAuthToken, recipeID string) (*recipe.Recipe, error) Checker(ctx context.Context, state *healthcheck.CheckState) error }
RecipeAPIClient interface to the recipe API.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides job related functionality.
func NewService ¶
func NewService(dataStore datastore.DataStorer, queue Queue, datasetAPIURL string, datasetAPIClient DatasetAPIClient, recipeAPIClient RecipeAPIClient, urlBuilder *url.Builder, serviceAuthToken string) *Service
NewService returns a new instance of a job.Service using the given dependencies.
func (Service) CreateJob ¶
CreateJob creates a new job using the instances corresponding to the recipe defined by recipeID in the provided job. A new instance will be posted to dataset api for each outputInstance defined in the recipe. Note that the provided job will be modified (ID and links will be updated).
Click to show internal directories.
Click to hide internal directories.