Versions in this module Expand all Collapse all v0 v0.16.0 Apr 28, 2023 Changes in this version + const ContextAdminKey + const ContextAuthRecordKey + const ContextCollectionKey + const ContextRequestDataKey + 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.RequestData + 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 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