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) GetHealthClient(name, url string) *health.Client
- func (e *ExternalServiceList) GetS3Client(cfg *config.Config) (s3Client upload.S3Client, err error)
- func (e *ExternalServiceList) GetVault(cfg *config.Config) (upload.VaultClient, 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) DoGetHealthClient(name, url string) *health.Client
- func (e *Init) DoGetS3Client(awsRegion, bucketName string, encryptionEnabled bool) (upload.S3Client, error)
- func (e *Init) DoGetVault(vaultToken, vaultAddress string, retries int) (upload.VaultClient, error)
- type Initialiser
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExternalServiceList ¶
type ExternalServiceList struct { HealthCheck 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) 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.Config, buildTime, gitCommit, version string) (HealthChecker, error)
GetHealthCheck creates a healthcheck with versionInfo and sets the HealthCheck flag to true
func (*ExternalServiceList) GetHealthClient ¶
func (e *ExternalServiceList) GetHealthClient(name, url string) *health.Client
GetHealthClient returns a healthclient for the provided URL
func (*ExternalServiceList) GetS3Client ¶
GetS3Client returns a new S3 client
func (*ExternalServiceList) GetVault ¶
func (e *ExternalServiceList) GetVault(cfg *config.Config) (upload.VaultClient, error)
GetVault creates a new vault 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) 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) DoGetHealthClient ¶
DoGetHealthClient creates a new Health Client for the provided name and url
func (*Init) DoGetS3Client ¶
func (e *Init) DoGetS3Client(awsRegion, bucketName string, encryptionEnabled bool) (upload.S3Client, error)
DoGetS3Client creates a new S3 Client
func (*Init) DoGetVault ¶
DoGetVault creates a new Vault client
type Initialiser ¶
type Initialiser interface { DoGetHTTPServer(bindAddr string, router http.Handler) HTTPServer DoGetHealthClient(name, url string) *health.Client DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error) DoGetVault(vaultToken, vaultAddress string, retries int) (upload.VaultClient, error) DoGetS3Client(awsRegion, bucketName string, encryptionEnabled bool) (upload.S3Client, error) }
Initialiser defines the methods to initialise external services
type Service ¶
type Service struct { Config *config.Config HealthCheck HealthChecker Router *pat.Router Server HTTPServer ServiceList *ExternalServiceList // contains filtered or unexported fields }
Service contains all the configs, server and clients to run Florence