response_handler

package
v0.0.0-...-4ad1eb6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	LinkOpts
	Metadata CollectionOpts `json:"_metadata"`
	Embedded Embedded       `json:"_embedded"`
}

func NewCollection

func NewCollection(basePath string, query db.SlicedQueryObject, mapFunc MappingFunc) *Collection

type CollectionOpts

type CollectionOpts struct {
	Offset int   `json:"offset"`
	Limit  int   `json:"limit"`
	Total  int64 `json:"total"`
}

type Embedded

type Embedded map[string]interface{}
type Link struct {
	Href string `json:"href"`
}

type LinkOpts

type LinkOpts struct {
	Links Links `json:"_links"`
}
func GenerateCollectionLinks(s *db.Slice, path string) LinkOpts
func GenerateSelfLink(path string) LinkOpts

type LinkResolver

type LinkResolver func(ctx echo.Context, e interface{}) (string, error)
type Links map[string]Link

type MappingFunc

type MappingFunc func(e interface{}) (interface{}, error)

type ResponseHandler

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

func NewResponseHandler

func NewResponseHandler() *ResponseHandler

func (*ResponseHandler) Handle

func (r *ResponseHandler) Handle(basePath string, query db.QueryObject) interface{}

func (*ResponseHandler) Register

func (r *ResponseHandler) Register(i interface{}, m MappingFunc)

type TypeErr

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

func NewTypeErr

func NewTypeErr(expected interface{}, actual interface{}) TypeErr

func (TypeErr) Error

func (e TypeErr) Error() string

type UnsupportedResultTypeErr

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

func NewUnsupportedQueryType

func NewUnsupportedQueryType(result interface{}) UnsupportedResultTypeErr

func (UnsupportedResultTypeErr) Error

func (e UnsupportedResultTypeErr) Error() string

Jump to

Keyboard shortcuts

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