Documentation
¶
Overview ¶
Package handler holds Site Manager's route handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateSiteCredsHandler ¶
type CreateSiteCredsHandler struct {
// contains filtered or unexported fields
}
CreateSiteCredsHandler exchanges a Site's OTP for its client credentials.
func NewCreateSiteCredsHandler ¶
func NewCreateSiteCredsHandler(sites crdclientv1.SiteInterface, certManager *certmanager.Client) CreateSiteCredsHandler
NewCreateSiteCredsHandler returns a handler that checks OTPs against sites and gets certificates from certManager.
func (CreateSiteCredsHandler) Handle ¶
func (csch CreateSiteCredsHandler) Handle(c echo.Context) error
Handle returns a client key, certificate and CA certificate for a Site waiting for its handshake, then marks the handshake complete. Every failure after decoding returns `500`, as Site Agent expects.
type CreateSiteHandler ¶
type CreateSiteHandler struct {
// contains filtered or unexported fields
}
CreateSiteHandler creates the Site resource and its first OTP.
func NewCreateSiteHandler ¶
func NewCreateSiteHandler(sites crdclientv1.SiteInterface, otpDuration time.Duration) CreateSiteHandler
NewCreateSiteHandler returns a handler that stores Sites in sites. Their OTPs expire after otpDuration.
type DeleteSiteHandler ¶
type DeleteSiteHandler struct {
// contains filtered or unexported fields
}
DeleteSiteHandler deletes a Site.
func NewDeleteSiteHandler ¶
func NewDeleteSiteHandler(sites crdclientv1.SiteInterface) DeleteSiteHandler
NewDeleteSiteHandler returns a handler that deletes Sites from sites.
type GetSiteHandler ¶
type GetSiteHandler struct {
// contains filtered or unexported fields
}
GetSiteHandler returns a Site with its OTP.
func NewGetSiteHandler ¶
func NewGetSiteHandler(sites crdclientv1.SiteInterface) GetSiteHandler
NewGetSiteHandler returns a handler that reads Sites from sites.
type HealthCheckHandler ¶
type HealthCheckHandler struct{}
HealthCheckHandler answers Kubernetes probes.
func NewHealthCheckHandler ¶
func NewHealthCheckHandler() HealthCheckHandler
NewHealthCheckHandler returns a health check handler.
type MetricsHandler ¶
type MetricsHandler struct {
// contains filtered or unexported fields
}
MetricsHandler serves the default Prometheus registry.
func NewMetricsHandler ¶
func NewMetricsHandler() MetricsHandler
NewMetricsHandler returns a handler for the default Prometheus registry.
type RegisterSiteHandler ¶
type RegisterSiteHandler struct {
// contains filtered or unexported fields
}
RegisterSiteHandler marks a Site's registration as complete.
func NewRegisterSiteHandler ¶
func NewRegisterSiteHandler(sites crdclientv1.SiteInterface) RegisterSiteHandler
NewRegisterSiteHandler returns a handler that updates Sites in sites.
type RollSiteHandler ¶
type RollSiteHandler struct {
// contains filtered or unexported fields
}
RollSiteHandler replaces a Site's OTP.
func NewRollSiteHandler ¶
func NewRollSiteHandler(sites crdclientv1.SiteInterface, otpDuration time.Duration) RollSiteHandler
NewRollSiteHandler returns a handler that updates Sites in sites. New OTPs expire after otpDuration.
type VersionHandler ¶
type VersionHandler struct {
// contains filtered or unexported fields
}
VersionHandler returns Site Manager's release version.
func NewVersionHandler ¶
func NewVersionHandler(version string) VersionHandler
NewVersionHandler returns a handler that answers with version.