endpoint

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Paginate added in v1.8.0

func Paginate(data interface{}, page, limit, total int64) interface{}

Paginate transfer object

Types

type Endpoint

type Endpoint func(ctx context.Context, request interface{}) (response EndpointResponse, err error)

Endpoint is the fundamental building block of servers and clients. It represents a single RPC method.

type EndpointResponse added in v1.6.0

type EndpointResponse interface {
	Code() int
	Data() interface{}
}

EndpointResponse the request result.

func Nop

func Nop(context.Context, interface{}) (EndpointResponse, error)

Nop is an endpoint that does nothing and returns a nil error. Useful for tests.

func Response added in v1.6.0

func Response(code int, data interface{}) EndpointResponse

Response transfer object

type Middleware

type Middleware func(Endpoint) Endpoint

Middleware is a chainable behavior modifier for endpoints.

func Database added in v1.5.0

func DatabaseWithTx added in v1.5.0

func DatabaseWithTx(dbfactory db.ConnectionFactory, key constants.DatabaseContextValue) Middleware

Jump to

Keyboard shortcuts

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