Documentation ¶
Index ¶
- type ExternalServiceList
- 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) GetImageAPI(ctx context.Context, cfg *config.Config) event.ImageAPIClient
- func (e *ExternalServiceList) GetKafkaConsumer(ctx context.Context, cfg *config.Config) (kafka.IConsumerGroup, error)
- func (e *ExternalServiceList) GetS3Clients(cfg *config.Config) (s3Uploaded event.S3Reader, s3Private event.S3Writer, err error)
- type HTTPServer
- type HealthChecker
- type Init
- 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) DoGetImageAPI(ctx context.Context, cfg *config.Config) event.ImageAPIClient
- func (e *Init) DoGetKafkaConsumer(ctx context.Context, cfg *config.Config) (kafka.IConsumerGroup, error)
- func (e *Init) DoGetS3Client(awsRegion, bucketName string) (event.S3Writer, error)
- func (e *Init) DoGetS3ClientWithSession(bucketName string, s *session.Session) event.S3Reader
- type Initialiser
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExternalServiceList ¶ added in v0.2.0
type ExternalServiceList struct { S3Private bool S3Uploaded bool ImageAPI bool HealthCheck bool KafkaConsumer bool Init Initialiser }
ExternalServiceList holds the initialiser and initialisation state of external services.
func NewServiceList ¶ added in v0.2.0
func NewServiceList(initialiser Initialiser) *ExternalServiceList
NewServiceList creates a new service list with the provided initialiser
func (*ExternalServiceList) GetHTTPServer ¶ added in v0.2.0
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 ¶ added in v0.2.0
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) GetImageAPI ¶ added in v0.3.0
func (e *ExternalServiceList) GetImageAPI(ctx context.Context, cfg *config.Config) event.ImageAPIClient
GetImageAPI creates an ImageAPI client and sets the ImageAPI flag to true
func (*ExternalServiceList) GetKafkaConsumer ¶ added in v0.4.0
func (e *ExternalServiceList) GetKafkaConsumer(ctx context.Context, cfg *config.Config) (kafka.IConsumerGroup, error)
GetKafkaConsumer creates a Kafka consumer and sets the consumer flag to true
func (*ExternalServiceList) GetS3Clients ¶ added in v0.6.0
func (e *ExternalServiceList) GetS3Clients(cfg *config.Config) (s3Uploaded event.S3Reader, s3Private event.S3Writer, err error)
GetS3Clients returns S3 clients uploaded and private. They share the same AWS session.
type HTTPServer ¶ added in v0.2.0
HTTPServer defines the required methods from the HTTP server
type HealthChecker ¶ added in v0.2.0
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 ¶ added in v0.2.0
type Init struct{}
Init implements the Initialiser interface to initialise dependencies
func (*Init) DoGetHTTPServer ¶ added in v0.2.0
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 ¶ added in v0.2.0
func (e *Init) DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error)
DoGetHealthCheck creates a healthcheck with versionInfo
func (*Init) DoGetImageAPI ¶ added in v0.3.0
DoGetImageAPI returns an Image API client
func (*Init) DoGetKafkaConsumer ¶ added in v0.4.0
func (e *Init) DoGetKafkaConsumer(ctx context.Context, cfg *config.Config) (kafka.IConsumerGroup, error)
DoGetKafkaConsumer returns a Kafka Consumer group
func (*Init) DoGetS3Client ¶ added in v0.6.0
DoGetS3Client creates a new S3Client for the provided AWS region and bucket name.
func (*Init) DoGetS3ClientWithSession ¶ added in v0.6.0
DoGetS3ClientWithSession creates a new S3Clienter (extension of S3Client with Upload operations) for the provided bucket name, using an existing AWS session
type Initialiser ¶ added in v0.2.0
type Initialiser interface { DoGetHTTPServer(bindAddr string, router http.Handler) HTTPServer DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error) DoGetS3Client(awsRegion, bucketName string) (event.S3Writer, error) DoGetS3ClientWithSession(bucketName string, s *session.Session) event.S3Reader DoGetImageAPI(ctx context.Context, cfg *config.Config) event.ImageAPIClient DoGetKafkaConsumer(ctx context.Context, cfg *config.Config) (kafka.IConsumerGroup, error) }
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 Image API