Documentation
¶
Index ¶
- Variables
- func HandleEchoError(err error, c echo.Context)
- func ToLogLevel(level string) slog.Level
- type ApiError
- func ErrorInvalidRequest(t string) ApiError
- func ErrorNotFound(t string) ApiError
- func NewApiUnimplementedError() *ApiError
- func NewClaimMissingError(claim string) *ApiError
- func NewDaoDbError() *ApiError
- func NewDaoNotExistingError(objectName, referenceKey string) *ApiError
- func NewDaoReferenceError(referenceObjectName, referenceKey string) *ApiError
- func NewDaoReferenceIdError(referenceObjectName string, id uint) *ApiError
- func NewDaoReferenceTimedError(referenceObjectName string, id uint, startValidity time.Time) *ApiError
- func NewDaoReferenceVersionedError(referenceObjectName string, id, version uint) *ApiError
- func NewDaoUnimplementedError() *ApiError
- func NewDaoValidationError(referenceObjectName, dataExpected, dataGot string) *ApiError
- func NewUnauthorizedError(msg string) *ApiError
- type ApiLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotImplemented = errors.New("this function is not implemented")
Functions ¶
func HandleEchoError ¶
Handles an error thrown by any echo context function This is used as echo.HTTPErrorHandler
func ToLogLevel ¶
Returns the corresponding slog log level for the given string
Types ¶
type ApiError ¶
API error struct
func ErrorInvalidRequest ¶
Returns an API error with a 400 status code and a message for type t
func ErrorNotFound ¶
Returns an API error with a 404 status code and a message for type t
func NewApiUnimplementedError ¶
func NewApiUnimplementedError() *ApiError
func NewClaimMissingError ¶
func NewDaoDbError ¶
func NewDaoDbError() *ApiError
func NewDaoNotExistingError ¶
func NewDaoReferenceError ¶
func NewDaoReferenceIdError ¶
func NewDaoUnimplementedError ¶
func NewDaoUnimplementedError() *ApiError
func NewDaoValidationError ¶
func NewUnauthorizedError ¶
type ApiLogger ¶
ApiLogger is a custom logger for the API
func NewApiLogger ¶
Returns a new ApiLogger with the given log level
func (ApiLogger) HandleValues ¶
func (l ApiLogger) HandleValues(c echo.Context, v middleware.RequestLoggerValues) error
HandleValues is a custom log handler for the echo logger middleware It handles the log values and logs them into the slog logger sink
Click to show internal directories.
Click to hide internal directories.