shared

package
v0.42.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InternalError     = &PersesError{message: "internal server error"}
	NotFoundError     = &PersesError{message: "document not found"}
	ConflictError     = &PersesError{message: "document already exists"}
	BadRequestError   = &PersesError{message: "bad request"}
	UnauthorizedError = &PersesError{message: "unauthorized"}
)

Functions

func ExtractParameters added in v0.40.0

func ExtractParameters(ctx echo.Context) apiInterface.Parameters

func HandleBadRequestError added in v0.26.0

func HandleBadRequestError(msg string) error

func HandleError

func HandleError(err error) error

HandleError is translating the given error to the echoHTTPError

func HandleUnauthorizedError added in v0.42.0

func HandleUnauthorizedError(msg string) error

Types

type Group added in v0.42.0

type Group struct {
	Path   string
	Groups []*Group
	Routes []*Route
}

func (*Group) DELETE added in v0.42.0

func (g *Group) DELETE(path string, h echo.HandlerFunc, isAnonymous bool)

func (*Group) GET added in v0.42.0

func (g *Group) GET(path string, h echo.HandlerFunc, isAnonymous bool)

func (*Group) Group added in v0.42.0

func (g *Group) Group(path string) *Group

func (*Group) POST added in v0.42.0

func (g *Group) POST(path string, h echo.HandlerFunc, isAnonymous bool)

func (*Group) PUT added in v0.42.0

func (g *Group) PUT(path string, h echo.HandlerFunc, isAnonymous bool)

type PersesError

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

func (*PersesError) Error

func (e *PersesError) Error() string

type Route added in v0.42.0

type Route struct {
	// Method is the HTTP method such as POST, PUT, DELETE, etc.
	Method  string
	Path    string
	Handler echo.HandlerFunc
	// IsAnonymous is telling if the given route should be accessible without a JWT token.
	IsAnonymous bool
}

func (*Route) Register added in v0.42.0

func (r *Route) Register(g *echo.Group, middleware ...echo.MiddlewareFunc)

type Toolbox

type Toolbox interface {
	Create(ctx echo.Context, entity api.Entity) error
	Update(ctx echo.Context, entity api.Entity) error
	Delete(ctx echo.Context) error
	Get(ctx echo.Context) error
	List(ctx echo.Context, q databaseModel.Query) error
}

Toolbox is an interface that defines the different methods that can be used in the different endpoint of the API. This is a way to align the code of the different endpoint.

func NewToolBox

func NewToolBox(service apiInterface.Service, rbac rbac.RBAC, kind v1.Kind) Toolbox

Directories

Path Synopsis
sql
Package dependency provides different manager that will be used to instantiate the different services and daos of the API.
Package dependency provides different manager that will be used to instantiate the different services and daos of the API.

Jump to

Keyboard shortcuts

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