Documentation
¶
Index ¶
- func GetListCantabularTransitions() []application.Transition
- func GetListMultivariateCantabularTransitions() []application.Transition
- func GetListStaticTransitions() []application.Transition
- func GetListTransitions() []application.Transition
- func GetStateMachine(ctx context.Context, dataStore store.DataStore) *application.StateMachine
- type Closer
- type DatsetAPIStore
- type ExternalServiceList
- func (e *ExternalServiceList) GetAuthorisationMiddleware(ctx context.Context, authorisationConfig *authorisation.Config) (authorisation.Middleware, error)
- func (e *ExternalServiceList) GetCloudflareClient(ctx context.Context, cfg *config.Configuration) (cloudflare.Clienter, error)
- func (e *ExternalServiceList) GetFilesAPIClient(ctx context.Context, cfg *config.Configuration) (filesAPISDK.Clienter, error)
- func (e *ExternalServiceList) GetGraphDB(ctx context.Context) (store.GraphDB, Closer, error)
- func (e *ExternalServiceList) GetHTTPServer(bindAddr string, router http.Handler) HTTPServer
- func (e *ExternalServiceList) GetHealthCheck(cfg *config.Configuration, buildTime, gitCommit, version string) (HealthChecker, error)
- func (e *ExternalServiceList) GetMongoDB(ctx context.Context, cfg config.MongoConfig) (store.MongoDB, error)
- func (e *ExternalServiceList) GetProducer(ctx context.Context, cfg *config.Configuration, topic string) (kafkaProducer kafka.IProducer, err error)
- type HTTPServer
- type HealthChecker
- type Init
- func (e *Init) DoGetAuthorisationMiddleware(ctx context.Context, authorisationConfig *authorisation.Config) (authorisation.Middleware, error)
- func (e *Init) DoGetCloudflareClient(ctx context.Context, cloudflareConfig *cloudflare.Config) (cloudflare.Clienter, error)
- func (e *Init) DoGetFilesAPIClient(ctx context.Context, cfg *config.Configuration) (filesAPISDK.Clienter, error)
- func (e *Init) DoGetGraphDB(ctx context.Context) (store.GraphDB, Closer, error)
- func (e *Init) DoGetHTTPServer(bindAddr string, router http.Handler) HTTPServer
- func (e *Init) DoGetHealthCheck(cfg *config.Configuration, buildTime, gitCommit, version string) (HealthChecker, error)
- func (e *Init) DoGetKafkaProducer(ctx context.Context, cfg *config.Configuration, topic string) (kafka.IProducer, error)
- func (e *Init) DoGetMongoDB(ctx context.Context, cfg config.MongoConfig) (store.MongoDB, error)
- type Initialiser
- type Service
- func (svc *Service) Close(ctx context.Context) error
- func (svc *Service) Run(ctx context.Context, buildTime, gitCommit, version string, ...) (err error)
- func (svc *Service) SetDownloadsProducer(producer kafka.IProducer)
- func (svc *Service) SetFilesAPIClient(filesAPIClient filesAPISDK.Clienter)
- func (svc *Service) SetGraphDB(graphDB store.GraphDB)
- func (svc *Service) SetGraphDBErrorConsumer(graphDBErrorConsumer Closer)
- func (svc *Service) SetHealthCheck(healthCheck HealthChecker)
- func (svc *Service) SetMongoDB(mongoDB store.MongoDB)
- func (svc *Service) SetServer(server HTTPServer)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetListCantabularTransitions ¶ added in v1.67.0
func GetListCantabularTransitions() []application.Transition
func GetListMultivariateCantabularTransitions ¶ added in v1.67.0
func GetListMultivariateCantabularTransitions() []application.Transition
func GetListStaticTransitions ¶ added in v1.68.0
func GetListStaticTransitions() []application.Transition
func GetListTransitions ¶ added in v1.67.0
func GetListTransitions() []application.Transition
func GetStateMachine ¶ added in v1.67.0
func GetStateMachine(ctx context.Context, dataStore store.DataStore) *application.StateMachine
Types ¶
type DatsetAPIStore ¶
DatsetAPIStore is a wrapper which embeds Neo4j Mongo structs which between them satisfy the store.Storer interface.
type ExternalServiceList ¶
type ExternalServiceList struct {
KafkaProducer bool
AuthorisationMiddleware bool
Graph bool
HealthCheck bool
MongoDB bool
FilesAPIClient bool
CloudflareClient bool
Init Initialiser
}
ExternalServiceList holds the initialiser and initialisation state of external services.
func NewServiceList ¶
func NewServiceList(initialiser Initialiser) *ExternalServiceList
NewServiceList creates a new service list with the provided initialiser
func (*ExternalServiceList) GetAuthorisationMiddleware ¶ added in v1.92.0
func (e *ExternalServiceList) GetAuthorisationMiddleware(ctx context.Context, authorisationConfig *authorisation.Config) (authorisation.Middleware, error)
GetAuthorisationMiddleware creates a new instance of authorisation.Middlware
func (*ExternalServiceList) GetCloudflareClient ¶ added in v1.94.0
func (e *ExternalServiceList) GetCloudflareClient(ctx context.Context, cfg *config.Configuration) (cloudflare.Clienter, error)
GetCloudflareClient returns a cloudflare client
func (*ExternalServiceList) GetFilesAPIClient ¶ added in v1.91.0
func (e *ExternalServiceList) GetFilesAPIClient(ctx context.Context, cfg *config.Configuration) (filesAPISDK.Clienter, error)
GetFilesAPIClient returns a files API client
func (*ExternalServiceList) GetGraphDB ¶
GetGraphDB returns a graphDB (only if observation and private endpoint are enabled)
func (*ExternalServiceList) GetHTTPServer ¶
func (e *ExternalServiceList) GetHTTPServer(bindAddr string, router http.Handler) HTTPServer
GetHTTPServer creates an http server
func (*ExternalServiceList) GetHealthCheck ¶
func (e *ExternalServiceList) GetHealthCheck(cfg *config.Configuration, buildTime, gitCommit, version string) (HealthChecker, error)
GetHealthCheck creates a healthcheck with versionInfo and sets the HealthCheck flag to true
func (*ExternalServiceList) GetMongoDB ¶
func (e *ExternalServiceList) GetMongoDB(ctx context.Context, cfg config.MongoConfig) (store.MongoDB, error)
GetMongoDB returns a mongodb health client and dataset mongo object
func (*ExternalServiceList) GetProducer ¶
func (e *ExternalServiceList) GetProducer(ctx context.Context, cfg *config.Configuration, topic string) (kafkaProducer kafka.IProducer, err error)
GetProducer returns a kafka producer, which might not be initialised yet.
type HTTPServer ¶
HTTPServer defines the required methods from the HTTP server
type HealthChecker ¶
type HealthChecker interface {
Handler(w http.ResponseWriter, req *http.Request)
Start(ctx context.Context)
Stop()
AddCheck(name string, checker healthcheck.Checker) (err error)
}
HealthChecker defines the required methods from Healthcheck
type Init ¶
type Init struct{}
Init implements the Initialiser interface to initialise dependencies
func (*Init) DoGetAuthorisationMiddleware ¶ added in v1.92.0
func (e *Init) DoGetAuthorisationMiddleware(ctx context.Context, authorisationConfig *authorisation.Config) (authorisation.Middleware, error)
DoGetAuthorisationMiddleware creates authorisation middleware for the given config
func (*Init) DoGetCloudflareClient ¶ added in v1.94.0
func (e *Init) DoGetCloudflareClient(ctx context.Context, cloudflareConfig *cloudflare.Config) (cloudflare.Clienter, error)
DoGetCloudflareClient returns a cloudflare client
func (*Init) DoGetFilesAPIClient ¶ added in v1.91.0
func (e *Init) DoGetFilesAPIClient(ctx context.Context, cfg *config.Configuration) (filesAPISDK.Clienter, error)
DoGetFilesAPIClient returns a files API client
func (*Init) DoGetGraphDB ¶
DoGetGraphDB creates a new GraphDB
func (*Init) DoGetHTTPServer ¶
func (e *Init) DoGetHTTPServer(bindAddr string, router http.Handler) HTTPServer
DoGetHTTPServer creates an HTTP Server with the provided bind address and router
func (*Init) DoGetHealthCheck ¶
func (e *Init) DoGetHealthCheck(cfg *config.Configuration, buildTime, gitCommit, version string) (HealthChecker, error)
DoGetHealthCheck creates a healthcheck with versionInfo
func (*Init) DoGetKafkaProducer ¶
func (e *Init) DoGetKafkaProducer(ctx context.Context, cfg *config.Configuration, topic string) (kafka.IProducer, error)
DoGetKafkaProducer creates a new Kafka Producer
func (*Init) DoGetMongoDB ¶
DoGetMongoDB returns a MongoDB
type Initialiser ¶
type Initialiser interface {
DoGetHTTPServer(bindAddr string, router http.Handler) HTTPServer
DoGetHealthCheck(cfg *config.Configuration, buildTime, gitCommit, version string) (HealthChecker, error)
DoGetKafkaProducer(ctx context.Context, cfg *config.Configuration, topic string) (kafka.IProducer, error)
DoGetGraphDB(ctx context.Context) (store.GraphDB, Closer, error)
DoGetMongoDB(ctx context.Context, cfg config.MongoConfig) (store.MongoDB, error)
DoGetAuthorisationMiddleware(ctx context.Context, authorisationConfig *authorisation.Config) (authorisation.Middleware, error)
DoGetFilesAPIClient(ctx context.Context, cfg *config.Configuration) (filesAPISDK.Clienter, error)
DoGetCloudflareClient(ctx context.Context, cloudflareConfig *cloudflare.Config) (cloudflare.Clienter, error)
}
Initialiser defines the methods to initialise external services
type Service ¶
type Service struct {
AuthMiddleware auth.Middleware
ZebedeeClient *health.Client
// contains filtered or unexported fields
}
Service contains all the configs, server and clients to run the Dataset API
func New ¶
func New(cfg *config.Configuration, serviceList *ExternalServiceList) *Service
New creates a new service
func (*Service) Run ¶
func (svc *Service) Run(ctx context.Context, buildTime, gitCommit, version string, svcErrors chan error) (err error)
Run the service
func (*Service) SetDownloadsProducer ¶
SetDownloadsProducer sets the downloads kafka producer for a service
func (*Service) SetFilesAPIClient ¶ added in v1.78.0
func (svc *Service) SetFilesAPIClient(filesAPIClient filesAPISDK.Clienter)
SetFilesAPIClient sets the files API client for a service
func (*Service) SetGraphDB ¶
SetGraphDB sets the graphDB connection for a service
func (*Service) SetGraphDBErrorConsumer ¶ added in v1.23.0
SetGraphDBErrorConsumer sets the graphDB error consumer for a service
func (*Service) SetHealthCheck ¶
func (svc *Service) SetHealthCheck(healthCheck HealthChecker)
SetHealthCheck sets the healthchecker for a service
func (*Service) SetMongoDB ¶
SetMongoDB sets the mongoDB connection for a service
func (*Service) SetServer ¶
func (svc *Service) SetServer(server HTTPServer)
SetServer sets the http server for a service