Documentation
¶
Index ¶
- func With(ctx context.Context, app *App) context.Context
- func WrapHandler(app *App, fn HandlerFunc) echo.HandlerFunc
- type App
- func (app *App) BasePath() string
- func (app *App) BaseURL(c *gin.Context) string
- func (app *App) EndpointPath(relativePath string) string
- func (app *App) Location() *time.Location
- func (app *App) MarkReady(ctx context.Context)
- func (app *App) MaxUploadSize() int64
- func (app *App) ParseTime(layout string, str string) (time.Time, error)
- func (app *App) String() string
- type CORS
- type Config
- type HandlerFunc
- type Router
- func (r *Router) DELETE(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
- func (r *Router) GET(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
- func (r *Router) Group(path string, handlers ...echo.MiddlewareFunc) *Router
- func (r *Router) OPTIONS(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
- func (r *Router) PATCH(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
- func (r *Router) POST(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
- func (r *Router) PUT(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapHandler ¶
func WrapHandler(app *App, fn HandlerFunc) echo.HandlerFunc
WrapHandler wraps a handler function into a gin.HandlerFunc.
Types ¶
type App ¶
type App struct { Config *Config IDM *idm.Provider Customers customerdb.Database Patients patientdb.Database Comments commentdb.Database VoiceMails voicemaildb.Database MailSync *mailsync.Manager Door *door.Controller Holidays openinghours.HolidayGetter LayoutStore layouts.Store InfoScreenShows infoscreendb.Database Cache cache.Cache Trigger *trigger.Registry Tmpl2PDF *tmpl2pdf.Creator RosterdServer string // contains filtered or unexported fields }
App holds dependencies for cis API request handlers.
func From ¶
From returns the App associated with c. If there is no context assigned to c the request is terminated with 500 Internal Server error.
func FromContext ¶
FromContext returns the App associated with c.
func NewApp ¶
func NewApp( cfg *Config, customers customerdb.Database, patients patientdb.Database, comments commentdb.Database, voicemail voicemaildb.Database, mailsyncManager *mailsync.Manager, door *door.Controller, holidays openinghours.HolidayGetter, layoutStore layouts.Store, infoScreens infoscreendb.Database, cache cache.Cache, triggerRegistry *trigger.Registry, pdfCreator *tmpl2pdf.Creator, RosterdServer string, idmProvider *idm.Provider, ) *App
NewApp context creates a new application context.
func (*App) BaseURL ¶
BaseURL returns the base URL if the application as configured in the BaseURL setting. If not configured the Host header of the HTTP request is used.
func (*App) EndpointPath ¶
EndpointPath returns the absolute path to the endpoint.
func (*App) Location ¶
Location returns the location CIS is running at. Deprecated: use Config.Location() instead.
func (*App) MaxUploadSize ¶
MaxUploadSize returns the maximum upload size allowed for infoscreen layout file uploads. It parses InfoScreenConfig.MaxUploadSize and fallsback to 1MB in case of an invalid setting.
type CORS ¶
type CORS struct { AllowAllOrigins bool AllowOrigins []string AllowMethods []string AllowHeaders []string AllowCredentials bool ExposeHeaders []string MaxAge string AllowWildcard bool AllowBrowserExtensions bool AllowWebSockets bool }
CORS is a type-alias to cors.Config to avoid additional imports in client packages.
type Config ¶
type Config struct { cfgspec.Config `section:"Global"` cfgspec.DatabaseConfig `section:"Global"` cfgspec.InfoScreenConfig `section:"InfoScreen"` CORS `section:"CORS"` // contains filtered or unexported fields }
Config holds the complete cisd configuration.
type HandlerFunc ¶
HandlerFunc defines a cis HTTP handler func.
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router wraps a gin router interface to use HandlerFunc instead of gin.HandlerFunc.
func (*Router) DELETE ¶
func (r *Router) DELETE(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
DELETE is like echo.Group.PATCH.
func (*Router) GET ¶
func (r *Router) GET(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
GET is like echo.Group.GET.
func (*Router) Group ¶
Group returns a new router that groups handlers at path. It works like echo.Group.Group.
func (*Router) OPTIONS ¶
func (r *Router) OPTIONS(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
OPTIONS is like echo.Group.OPTIONS.
func (*Router) PATCH ¶
func (r *Router) PATCH(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
PATCH is like echo.Group.PATCH.
func (*Router) POST ¶
func (r *Router) POST(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
POST is like echo.Group.POST.
func (*Router) PUT ¶
func (r *Router) PUT(path string, handler HandlerFunc, middlewares ...echo.MiddlewareFunc)
PUT is like echo.Group.PUT.