apiinterface

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0 Imports: 8 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"}
	ForbiddenError       = &PersesError{message: "forbidden access"}
	UnsupportedMediaType = &PersesError{message: "unsupported media type"}
)

Functions

func HandleBadRequestError added in v0.44.0

func HandleBadRequestError(msg string) error

func HandleError added in v0.44.0

func HandleError(err error) error

HandleError is translating the given error to the echo.HTTPError

func HandleForbiddenError added in v0.44.0

func HandleForbiddenError(msg string) error

func HandleNotFoundError added in v0.44.0

func HandleNotFoundError(msg string) error

func HandleUnauthorizedError added in v0.44.0

func HandleUnauthorizedError(msg string) error

Types

type Parameters

type Parameters struct {
	Project string
	Name    string
}

type PersesError added in v0.44.0

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

func (*PersesError) Error added in v0.44.0

func (e *PersesError) Error() string

type Service

type Service[T api.Entity, K api.Entity, V databaseModel.Query] interface {
	Create(ctx echo.Context, entity T) (K, error)
	Update(ctx echo.Context, entity T, parameters Parameters) (K, error)
	Delete(ctx echo.Context, parameters Parameters) error
	Get(parameters Parameters) (K, error)
	List(query V, parameters Parameters) ([]K, error)
	RawList(query V, parameters Parameters) ([]json.RawMessage, error)
	MetadataList(query V, parameters Parameters) ([]api.Entity, error)
	RawMetadataList(query V, parameters Parameters) ([]json.RawMessage, error)
}

Jump to

Keyboard shortcuts

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