Documentation ¶
Index ¶
- func RegisterCheckers(ctx context.Context, hc *healthcheck.HealthCheck, ...) (err error)
- func StartHealthCheck(ctx context.Context, hc *healthcheck.HealthCheck, bindAddr string, ...)
- func StopHealthCheck(ctx context.Context, hc *healthcheck.HealthCheck) (err error)
- type DatasetAPI
- func (api *DatasetAPI) GetInstance(ctx context.Context, instanceID string) (instance dataset.Instance, isFatal bool, err error)
- func (api *DatasetAPI) GetInstances(ctx context.Context, vars url.Values) (instances dataset.Instances, isFatal bool, err error)
- func (api *DatasetAPI) SetImportObservationTaskComplete(ctx context.Context, instanceID string) (isFatal bool, err error)
- func (api *DatasetAPI) UpdateInstanceState(ctx context.Context, instanceID string, newState dataset.State) (isFatal bool, err error)
- func (api *DatasetAPI) UpdateInstanceWithHierarchyBuilt(ctx context.Context, instanceID, dimensionID string) (isFatal bool, err error)
- func (api *DatasetAPI) UpdateInstanceWithNewInserts(ctx context.Context, instanceID string, observationsInserted int32) (isFatal bool, err error)
- func (api *DatasetAPI) UpdateInstanceWithSearchIndexBuilt(ctx context.Context, instanceID, dimensionID string) (isFatal bool, err error)
- type DatasetClient
- type ImportAPI
- type ImportAPIClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterCheckers ¶
func RegisterCheckers(ctx context.Context, hc *healthcheck.HealthCheck, newInstanceEventConsumer *kafka.ConsumerGroup, observationsInsertedEventConsumer *kafka.ConsumerGroup, hierarchyBuiltConsumer *kafka.ConsumerGroup, searchBuiltConsumer *kafka.ConsumerGroup, dataImportCompleteProducer *kafka.Producer, importAPI ImportAPIClient, datasetAPI DatasetClient, graphDB *graph.DB) (err error)
RegisterCheckers adds the checkers for the provided clients to the healthcheck object. VaultClient health client will only be registered if encryption is enabled.
func StartHealthCheck ¶
func StartHealthCheck(ctx context.Context, hc *healthcheck.HealthCheck, bindAddr string, serverDone chan error)
StartHealthCheck sets up the Handler, starts the healthcheck and the http server that serves healthcheck endpoint
func StopHealthCheck ¶
func StopHealthCheck(ctx context.Context, hc *healthcheck.HealthCheck) (err error)
StopHealthCheck shuts down the http listener
Types ¶
type DatasetAPI ¶
type DatasetAPI struct { ServiceAuthToken string Client DatasetClient MaxWorkers int BatchSize int }
DatasetAPI extends the dataset api Client with json - bson mapping, specific calls, and error management
func (*DatasetAPI) GetInstance ¶
func (api *DatasetAPI) GetInstance(ctx context.Context, instanceID string) (instance dataset.Instance, isFatal bool, err error)
GetInstance asks the Dataset API for the details for instanceID
func (*DatasetAPI) GetInstances ¶
func (api *DatasetAPI) GetInstances(ctx context.Context, vars url.Values) (instances dataset.Instances, isFatal bool, err error)
GetInstances asks the Dataset API for all instances filtered by vars
func (*DatasetAPI) SetImportObservationTaskComplete ¶
func (api *DatasetAPI) SetImportObservationTaskComplete(ctx context.Context, instanceID string) (isFatal bool, err error)
SetImportObservationTaskComplete marks the import observation task state as completed for an instance
func (*DatasetAPI) UpdateInstanceState ¶
func (api *DatasetAPI) UpdateInstanceState(ctx context.Context, instanceID string, newState dataset.State) (isFatal bool, err error)
UpdateInstanceState tells the Dataset API that the state has changed of a Dataset instance
func (*DatasetAPI) UpdateInstanceWithHierarchyBuilt ¶
func (api *DatasetAPI) UpdateInstanceWithHierarchyBuilt(ctx context.Context, instanceID, dimensionID string) (isFatal bool, err error)
UpdateInstanceWithHierarchyBuilt marks a hierarchy build task state as completed for an instance.
func (*DatasetAPI) UpdateInstanceWithNewInserts ¶
func (api *DatasetAPI) UpdateInstanceWithNewInserts(ctx context.Context, instanceID string, observationsInserted int32) (isFatal bool, err error)
UpdateInstanceWithNewInserts increments the observation inserted count for an instance
func (*DatasetAPI) UpdateInstanceWithSearchIndexBuilt ¶
func (api *DatasetAPI) UpdateInstanceWithSearchIndexBuilt(ctx context.Context, instanceID, dimensionID string) (isFatal bool, err error)
UpdateInstanceWithSearchIndexBuilt marks a search index build task state as completed for an instance.
type DatasetClient ¶
type DatasetClient interface { GetInstance(ctx context.Context, userAuthToken, serviceAuthToken, collectionID, instanceID, ifMatch string) (m dataset.Instance, eTag string, err error) GetInstancesInBatches(ctx context.Context, userAuthToken, serviceAuthToken, collectionID string, vars url.Values, batchSize, maxWorkers int) (instances dataset.Instances, err error) PutInstanceImportTasks(ctx context.Context, serviceAuthToken, instanceID string, data dataset.InstanceImportTasks, ifMatch string) (eTag string, err error) UpdateInstanceWithNewInserts(ctx context.Context, serviceAuthToken, instanceID string, observationsInserted int32, ifMatch string) (eTag string, err error) PutInstanceState(ctx context.Context, serviceAuthToken, instanceID string, state dataset.State, ifMatch string) (eTag string, err error) Checker(ctx context.Context, check *healthcheck.CheckState) error }
DatasetClient is an interface to represent methods called to action upon Dataset REST interface
type ImportAPI ¶
type ImportAPI struct { ServiceAuthToken string Client ImportAPIClient }
ImportAPI extends the import api Client with error management and service token
type ImportAPIClient ¶
type ImportAPIClient interface { GetImportJob(ctx context.Context, importJobID, serviceToken string) (importJob importapi.ImportJob, err error) UpdateImportJobState(ctx context.Context, jobID, serviceToken string, newState string) error Checker(ctx context.Context, check *healthcheck.CheckState) error }
ImportAPIClient is an interface to represent methods called to action upon Import API REST interface