Documentation ¶
Index ¶
- Constants
- type EventConsumer
- type ExternalServiceList
- func (e *ExternalServiceList) GetDatasetClient(cfg *config.Config) clients.DatasetClient
- func (e *ExternalServiceList) GetHTTPServer(bindAddr string, router http.Handler) HTTPServer
- func (e *ExternalServiceList) GetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error)
- func (e *ExternalServiceList) GetKafkaConsumer(ctx context.Context, cfg *config.Config) (dpkafka.IConsumerGroup, error)
- func (e *ExternalServiceList) GetKafkaProducer(ctx context.Context, cfg *config.Config) (dpkafka.IProducer, error)
- func (e *ExternalServiceList) GetZebedee(cfg *config.Config) clients.ZebedeeClient
- type HTTPServer
- type HealthChecker
- type Init
- func (e *Init) DoGetDatasetClient(cfg *config.Config) clients.DatasetClient
- func (e *Init) DoGetHTTPServer(bindAddr string, router http.Handler) HTTPServer
- func (e *Init) DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error)
- func (e *Init) DoGetKafkaConsumer(ctx context.Context, cfg *config.Config) (dpkafka.IConsumerGroup, error)
- func (e *Init) DoGetKafkaProducer(ctx context.Context, cfg *config.Config) (dpkafka.IProducer, error)
- func (e *Init) DoGetZebedeeClient(cfg *config.Config) clients.ZebedeeClient
- type Initialiser
- type Service
Constants ¶
const KafkaTLSProtocolFlag = "TLS"
KafkaTLSProtocolFlag informs service to use TLS protocol for kafka
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventConsumer ¶
EventConsumer defines the required methods from event Consumer
type ExternalServiceList ¶
type ExternalServiceList struct { HealthCheck bool KafkaConsumer bool KafkaProducer bool Init Initialiser ZebedeeClient bool DatasetClient bool }
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) GetDatasetClient ¶ added in v0.7.0
func (e *ExternalServiceList) GetDatasetClient(cfg *config.Config) clients.DatasetClient
GetDatasetClient return DatasetAPI client
func (*ExternalServiceList) GetHTTPServer ¶
func (e *ExternalServiceList) GetHTTPServer(bindAddr string, router http.Handler) HTTPServer
GetHTTPServer creates an http server and sets the Server flag to true
func (*ExternalServiceList) GetHealthCheck ¶
func (e *ExternalServiceList) GetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error)
GetHealthCheck creates a healthcheck with versionInfo and sets teh HealthCheck flag to true
func (*ExternalServiceList) GetKafkaConsumer ¶
func (e *ExternalServiceList) GetKafkaConsumer(ctx context.Context, cfg *config.Config) (dpkafka.IConsumerGroup, error)
GetKafkaConsumer creates a Kafka consumer and sets the consumer flag to true
func (*ExternalServiceList) GetKafkaProducer ¶ added in v0.2.0
func (e *ExternalServiceList) GetKafkaProducer(ctx context.Context, cfg *config.Config) (dpkafka.IProducer, error)
GetKafkaProducer creates a Kafka producer and sets the producder flag to true
func (*ExternalServiceList) GetZebedee ¶ added in v0.2.0
func (e *ExternalServiceList) GetZebedee(cfg *config.Config) clients.ZebedeeClient
GetZebedee return zebedee client
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) DoGetDatasetClient ¶ added in v0.7.0
func (e *Init) DoGetDatasetClient(cfg *config.Config) clients.DatasetClient
DoGetZebedeeClient gets and initialises the Zebedee Client
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.Config, buildTime, gitCommit, version string) (HealthChecker, error)
DoGetHealthCheck creates a healthcheck with versionInfo
func (*Init) DoGetKafkaConsumer ¶
func (e *Init) DoGetKafkaConsumer(ctx context.Context, cfg *config.Config) (dpkafka.IConsumerGroup, error)
DoGetKafkaConsumer returns a Kafka Consumer group
func (*Init) DoGetKafkaProducer ¶ added in v0.2.0
func (*Init) DoGetZebedeeClient ¶ added in v0.2.0
func (e *Init) DoGetZebedeeClient(cfg *config.Config) clients.ZebedeeClient
DoGetZebedeeClient gets and initialises the Zebedee Client
type Initialiser ¶
type Initialiser interface { DoGetHTTPServer(bindAddr string, router http.Handler) HTTPServer DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error) DoGetKafkaConsumer(ctx context.Context, cfg *config.Config) (dpkafka.IConsumerGroup, error) DoGetKafkaProducer(ctx context.Context, cfg *config.Config) (dpkafka.IProducer, error) DoGetZebedeeClient(cfg *config.Config) clients.ZebedeeClient DoGetDatasetClient(cfg *config.Config) clients.DatasetClient }
Initialiser defines the methods to initialise external services
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service contains all the configs, server and clients to run the event handler service