Documentation
¶
Index ¶
- Variables
- func GetUcredContextValue(ctx context.Context) (*unix.Ucred, bool)
- type Collector
- type Config
- type Server
- func (s *Server) AddRoutes(ctx context.Context, router *mux.Router)
- func (s *Server) ClaimsGenHandler(rw http.ResponseWriter, req *http.Request)
- func (s *Server) ClaimsHandler(rw http.ResponseWriter, req *http.Request)
- func (s *Server) ClaimsKopanoProductsHandler(rw http.ResponseWriter, req *http.Request)
- func (s *Server) HealthCheckHandler(rw http.ResponseWriter, req *http.Request)
- func (s *Server) MakeClaimsWatchHandler() http.HandlerFunc
- func (s *Server) ReloadHandler(rw http.ResponseWriter, req *http.Request)
- func (s *Server) Serve(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ( DefaultLicenseJWKSURI = "" // Set on build. DefaultLicenseCertsBase64 = "" // Set on build. )
var UcredContextKey = &contextKey{"http-server"}
UcredContextKey is a context key. It can be used in HTTP handlers with Context.Value to access the Ucred struct of the request connection. The associated value will be of type *syscall.Ucred
Functions ¶
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct { Sub string LicensesPath string ListenPath string Insecure bool Trusted bool JWKSURIs []*url.URL CertPool *x509.CertPool Logger logrus.FieldLogger OnFirstClaims func(*Server) }
Config bundles configuration settings.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is our HTTP server implementation.
func NewServer ¶
NewServer constructs a server from the provided parameters.
func (*Server) AddRoutes ¶
AddRoutes add the associated Servers URL routes to the provided router with the provided context.Context.
func (*Server) ClaimsGenHandler ¶
func (s *Server) ClaimsGenHandler(rw http.ResponseWriter, req *http.Request)
ClaimsGenHandler is a http handler which can be used to generate license claims using simple URL form requests.
func (*Server) ClaimsHandler ¶
func (s *Server) ClaimsHandler(rw http.ResponseWriter, req *http.Request)
ClaimsHandler is the http hadnler to return the active claims.
func (*Server) ClaimsKopanoProductsHandler ¶
func (s *Server) ClaimsKopanoProductsHandler(rw http.ResponseWriter, req *http.Request)
ClaimsKopanoProductsHandler is a http handler to return the Kopano product data from all currently active license claims as array.
func (*Server) HealthCheckHandler ¶
func (s *Server) HealthCheckHandler(rw http.ResponseWriter, req *http.Request)
HealthCheckHandler a http handler return 200 OK when server health is fine.
func (*Server) MakeClaimsWatchHandler ¶
func (s *Server) MakeClaimsWatchHandler() http.HandlerFunc
MakeClaimsWatchHandler return a http handler which returns claims related events as server sent events.