Documentation ¶
Index ¶
- type ExternalServiceList
- func (e *ExternalServiceList) GetAuthorisationMiddleware(ctx context.Context, authorisationConfig *authorisation.Config) (authorisation.Middleware, error)
- func (e *ExternalServiceList) GetCognitoClient(region string) cognitoclient.Client
- func (e *ExternalServiceList) GetHTTPServer(bindAddr string, router http.Handler, cfg *config.Config) HTTPServer
- func (e *ExternalServiceList) GetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error)
- type HTTPServer
- type HealthChecker
- type Init
- func (e *Init) DoGetAuthorisationMiddleware(ctx context.Context, authorisationConfig *authorisation.Config) (authorisation.Middleware, error)
- func (e *Init) DoGetCognitoClient(AWSRegion string) cognitoclient.Client
- func (e *Init) DoGetHTTPServer(bindAddr string, router http.Handler, cfg *config.Config) HTTPServer
- func (e *Init) DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, 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 { AuthMiddleware bool 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) GetAuthorisationMiddleware ¶ added in v1.31.0
func (e *ExternalServiceList) GetAuthorisationMiddleware(ctx context.Context, authorisationConfig *authorisation.Config) (authorisation.Middleware, error)
GetAuthorisationMiddleware creates a new instance of authorisation.Middlware
func (*ExternalServiceList) GetCognitoClient ¶ added in v1.5.0
func (e *ExternalServiceList) GetCognitoClient(region string) cognitoclient.Client
GetCognitoClient creates a cognito client
func (*ExternalServiceList) GetHTTPServer ¶
func (e *ExternalServiceList) GetHTTPServer(bindAddr string, router http.Handler, cfg *config.Config) 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
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.31.0
func (e *Init) DoGetAuthorisationMiddleware(ctx context.Context, authorisationConfig *authorisation.Config) (authorisation.Middleware, error)
DoGetAuthorisationMiddleware creates authorisation middleware for the given config
func (*Init) DoGetCognitoClient ¶ added in v1.5.0
func (e *Init) DoGetCognitoClient(AWSRegion string) cognitoclient.Client
DoGetCognitoClient creates a CognitoClient with the provided region
func (*Init) DoGetHTTPServer ¶
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
type Initialiser ¶
type Initialiser interface { DoGetHTTPServer(bindAddr string, router http.Handler, cfg *config.Config) HTTPServer DoGetHealthCheck(cfg *config.Config, buildTime, gitCommit, version string) (HealthChecker, error) DoGetCognitoClient(region string) cognitoclient.Client DoGetAuthorisationMiddleware(ctx context.Context, authorisationConfig *authorisation.Config) (authorisation.Middleware, error) }
Initialiser defines the methods to initialise external services
type Service ¶
type Service struct { Config *config.Config Server HTTPServer Router *mux.Router Api *api.API ServiceList *ExternalServiceList HealthCheck HealthChecker // contains filtered or unexported fields }
Service contains all the configs, server and clients to run the dp-identity-api API