Documentation
¶
Overview ¶
Package api lists Site Manager's routes.
Index ¶
Constants ¶
const ( CreateSiteRouteName = "createSite" GetSiteRouteName = "getSite" DeleteSiteRouteName = "deleteSite" RollSiteRouteName = "rollSite" RegisterSiteRouteName = "registerSite" CreateSiteCredsRouteName = "createSiteCreds" )
Names of the Site routes. Clients resolve their paths by name with NewSiteRouteResolver.
Variables ¶
This section is empty.
Functions ¶
func NewSiteRouteResolver ¶
NewSiteRouteResolver returns an Echo instance with the Site routes registered by name. Clients resolve a Site route's path with its Reverse method. The resolver never runs the handlers, so they're built without their dependencies.
Types ¶
type RequestHandler ¶
RequestHandler defines the Echo compatible interface all route handlers implement.
type Route ¶
type Route struct {
Name string
Path string
Method string
Handler RequestHandler
}
Route holds the path, method and handler of one route. Name lets clients resolve the route's path with Echo's Reverse.
func NewSiteRoutes ¶
func NewSiteRoutes(sites crdclientv1.SiteInterface, otpDuration time.Duration, certManager *certmanager.Client) []Route
NewSiteRoutes returns the routes that manage Sites in sites and hand out their credentials. OTPs expire after otpDuration.
func NewSystemRoutes ¶
NewSystemRoutes returns the health, version and metrics routes.