Documentation
¶
Index ¶
- Constants
- type ExternalServiceList
- func (e *ExternalServiceList) GetConsumer(ctx context.Context, cfg *config.Config) (kafkaConsumer kafka.IConsumerGroup, err error)
- func (e *ExternalServiceList) GetGraphDB(ctx context.Context) (*graph.DB, error)
- func (e *ExternalServiceList) GetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (healthcheck.HealthCheck, error)
- func (e *ExternalServiceList) GetImportErrorReporter(observationsImportedErrProducer reporter.KafkaProducer, serviceName string) (errorReporter reporter.ImportErrorReporter, err error)
- func (e *ExternalServiceList) GetProducer(ctx context.Context, kafkaBrokers []string, topic string, ...) (kafkaProducer kafka.IProducer, err error)
- type Init
- func (i *Init) DoGetConsumer(ctx context.Context, topic, group string, kafkaConfig *config.KafkaConfig) (kafkaConsumer kafka.IConsumerGroup, err error)
- func (i *Init) DoGetGraphDB(ctx context.Context) (*graph.DB, error)
- func (i *Init) DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (healthcheck.HealthCheck, error)
- func (i *Init) DoGetImportErrorReporter(observationsImportedErrProducer reporter.KafkaProducer, serviceName string) (errorReporter reporter.ImportErrorReporter, err error)
- func (i *Init) DoGetProducer(ctx context.Context, topic string, kafkaConfig *config.KafkaConfig) (kafkaProducer kafka.IProducer, err error)
- type Initialiser
- type KafkaProducerName
Constants ¶
const ( ObservationsImported = iota ObservationsImportedErr )
Possible names of Kafka Producers
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExternalServiceList ¶
type ExternalServiceList struct { Consumer bool ObservationsImportedProducer bool ObservationsImportedErrProducer bool Graph bool ErrorReporter bool HealthCheck bool Init Initialiser }
ExternalServiceList represents a list of services
func NewServiceList ¶ added in v1.6.0
func NewServiceList(initialiser Initialiser) ExternalServiceList
NewServiceList creates a new service list with the provided initialiser
func (*ExternalServiceList) GetConsumer ¶
func (e *ExternalServiceList) GetConsumer(ctx context.Context, cfg *config.Config) (kafkaConsumer kafka.IConsumerGroup, err error)
GetConsumer returns a kafka consumer, which might not be initialised yet.
func (*ExternalServiceList) GetGraphDB ¶
GetGraphDB returns a graphDB
func (*ExternalServiceList) GetHealthCheck ¶
func (e *ExternalServiceList) GetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (healthcheck.HealthCheck, error)
GetHealthCheck creates a healthcheck with versionInfo
func (*ExternalServiceList) GetImportErrorReporter ¶
func (e *ExternalServiceList) GetImportErrorReporter(observationsImportedErrProducer reporter.KafkaProducer, serviceName string) (errorReporter reporter.ImportErrorReporter, err error)
GetImportErrorReporter returns an ErrorImportReporter to send error reports to the import-reporter (only if ObservationsImportedErrProducer is available)
func (*ExternalServiceList) GetProducer ¶
func (e *ExternalServiceList) GetProducer(ctx context.Context, kafkaBrokers []string, topic string, name KafkaProducerName, cfg *config.Config) (kafkaProducer kafka.IProducer, err error)
GetProducer returns a kafka producer, which might not be initialised yet.
type Init ¶ added in v1.6.0
type Init struct{}
Init implements the Initialiser interface to initialise dependencies
func (*Init) DoGetConsumer ¶ added in v1.6.0
func (i *Init) DoGetConsumer(ctx context.Context, topic, group string, kafkaConfig *config.KafkaConfig) (kafkaConsumer kafka.IConsumerGroup, err error)
func (*Init) DoGetGraphDB ¶ added in v1.6.0
func (*Init) DoGetHealthCheck ¶ added in v1.6.0
func (i *Init) DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (healthcheck.HealthCheck, error)
func (*Init) DoGetImportErrorReporter ¶ added in v1.6.0
func (i *Init) DoGetImportErrorReporter(observationsImportedErrProducer reporter.KafkaProducer, serviceName string) (errorReporter reporter.ImportErrorReporter, err error)
type Initialiser ¶ added in v1.6.0
type Initialiser interface { DoGetConsumer(context.Context, string, string, *config.KafkaConfig) (kafka.IConsumerGroup, error) DoGetProducer(context.Context, string, *config.KafkaConfig) (kafka.IProducer, error) DoGetImportErrorReporter(reporter.KafkaProducer, string) (reporter.ImportErrorReporter, error) DoGetHealthCheck(*config.Config, string, string, string) (healthcheck.HealthCheck, error) DoGetGraphDB(context.Context) (*graph.DB, error) }
type KafkaProducerName ¶
type KafkaProducerName int
KafkaProducerName : Type for kafka producer name used by iota constants
func (KafkaProducerName) String ¶
func (k KafkaProducerName) String() string
Values of the kafka producers names