Versions in this module Expand all Collapse all v1 v1.0.4 Apr 29, 2024 v1.0.3 Apr 27, 2024 v1.0.2 Apr 27, 2024 Changes in this version + const ContextAdminKey + const ContextAuthRecordKey + const ContextCollectionKey + const ContextExecStartKey + const ContextRequestInfoKey + func ActivityLogger(app core.App) echo.MiddlewareFunc + func EnrichRecord(c echo.Context, dao *daos.Dao, record *models.Record, defaultExpands ...string) error + func EnrichRecords(c echo.Context, dao *daos.Dao, records []*models.Record, ...) error + func InitApi(app core.App) (*echo.Echo, error) + func LoadAuthContext(app core.App) echo.MiddlewareFunc + func LoadCollectionContext(app core.App, optCollectionTypes ...string) echo.MiddlewareFunc + func RecordAuthResponse(app core.App, c echo.Context, authRecord *models.Record, meta any, ...) error + func RequestData(c echo.Context) *models.RequestInfo + func RequestInfo(c echo.Context) *models.RequestInfo + func RequireAdminAuth() echo.MiddlewareFunc + func RequireAdminAuthOnlyIfAny(app core.App) echo.MiddlewareFunc + func RequireAdminOrOwnerAuth(ownerIdParam string) echo.MiddlewareFunc + func RequireAdminOrRecordAuth(optCollectionNames ...string) echo.MiddlewareFunc + func RequireGuestOnly() echo.MiddlewareFunc + func RequireRecordAuth(optCollectionNames ...string) echo.MiddlewareFunc + func RequireSameContextRecordAuth() echo.MiddlewareFunc + func Serve(app core.App, config ServeConfig) (*http.Server, error) + func StaticDirectoryHandler(fileSystem fs.FS, indexFallback bool) echo.HandlerFunc + type ApiError struct + Code int + Data map[string]any + Message string + func NewApiError(status int, message string, data any) *ApiError + func NewBadRequestError(message string, data any) *ApiError + func NewForbiddenError(message string, data any) *ApiError + func NewNotFoundError(message string, data any) *ApiError + func NewUnauthorizedError(message string, data any) *ApiError + func (e *ApiError) Error() string + func (e *ApiError) RawData() any + type ServeConfig struct + AllowedOrigins []string + CertificateDomains []string + HttpAddr string + HttpsAddr string + ShowStartBanner bool