Documentation ¶
Overview ¶
Interface definitions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is the main object to create a web application has the config as attribute and it is basically a wrapper around a mux.Router with helpers method to add endpoints (grouped via BlueprintInterface) also monitor andlogger are attributes
func NewAPI ¶
func NewAPI(cfg APIConfigInterface) *API
NewAPI returns a new API object implementing webiface.APIInterface by default the monitoring and status blueprints are registered and the APITimer and APICount middleware are applied
func (*API) RegisterBlueprints ¶
func (a *API) RegisterBlueprints(r *chi.Mux, blueprints ...webiface.BlueprintInterface)
UseMiddlewares will register all the blueprints to the passed in router if no router r is passed, then the main one is used
type APIConfigInterface ¶
type APIConfigInterface interface { GetServiceName() string GetTracer() trace.Tracer GetMonitor() core.MonitorInterface GetCORSConfig() config.CORSConfigInterface GetLogger() logging.LoggerInterface }
Click to show internal directories.
Click to hide internal directories.