api

package
v0.34.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDocumentNotFound = NotFoundError{"document not found"}

Functions

func ErrorHandler

func ErrorHandler(err error, ctx echo.Context)

func GetDocumentHandler

func GetDocumentHandler(db *database.DB) echo.HandlerFunc

func GetUserDocumentsHandler

func GetUserDocumentsHandler(db *database.DB) echo.HandlerFunc

func GetUserHandler added in v0.6.0

func GetUserHandler(db *database.DB) echo.HandlerFunc

func GetUsersHandler added in v0.6.0

func GetUsersHandler(db *database.DB) echo.HandlerFunc

func ListenAndServe

func ListenAndServe(ctx context.Context, e *echo.Echo, addr string) error

func NewServer

func NewServer(config Config) *echo.Echo

New creates a new server. Use ListenAndServe to start accepting connections.

func PatchUserHandler added in v0.6.0

func PatchUserHandler(db *database.DB) echo.HandlerFunc

func PostAgreementsHandler

func PostAgreementsHandler(db *database.DB) echo.HandlerFunc

func PostUserHandler added in v0.6.0

func PostUserHandler(db *database.DB) echo.HandlerFunc

func PutDocumentHandler

func PutDocumentHandler(db *database.DB) echo.HandlerFunc

Types

type Config

type Config struct {
	DB                *database.DB
	BasicAuthUsername string
	BasicAuthPassword string
	LogWriter         io.Writer
}

type EchoCustomValidator added in v0.6.0

type EchoCustomValidator struct {
	// contains filtered or unexported fields
}

func (*EchoCustomValidator) Validate added in v0.6.0

func (ecv *EchoCustomValidator) Validate(i interface{}) error

type InternalServerError added in v0.10.0

type InternalServerError struct {
	InternalError error
}

func (InternalServerError) Error added in v0.10.0

func (err InternalServerError) Error() string

type NotFoundError added in v0.10.0

type NotFoundError struct {
	Message string
}

func (NotFoundError) Error added in v0.10.0

func (err NotFoundError) Error() string

type PatchRequest added in v0.9.0

type PatchRequest struct {
	Email    *string `json:"user_email" validate:"omitempty,email"`
	Username string  `json:"username" validate:"required"`
}

type ValidationError added in v0.10.0

type ValidationError struct {
	ValidationErrors validator.ValidationErrors
}

func (ValidationError) Error added in v0.10.0

func (err ValidationError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL