commons

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFn

func NewFn(name string, readonly bool, internal bool, authorized bool, permission bool, metric bool, barrier bool, handler FnHandler, middlewares ...FnHandlerMiddleware) services.Fn

Types

type Fn

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

Fn builtin fn handler wrapper supported annotations @fn {name} @readonly @authorization @permission @validation @cache {command} {ttl} @cache-control {options} @barrier @metric @middlewares >>> {path}.{IdentName} ... <<< @title {title} @description >>> {description} <<< @errors >>> {error_name} zh: {zh_message} en: {en_message} <<<

func (*Fn) Handle

func (fn *Fn) Handle(r services.Request) (v interface{}, err error)

func (*Fn) Internal

func (fn *Fn) Internal() bool

func (*Fn) Name

func (fn *Fn) Name() string

func (*Fn) Readonly

func (fn *Fn) Readonly() bool

type FnHandler

type FnHandler func(ctx services.Request) (v any, err error)

type FnHandlerMiddleware

type FnHandlerMiddleware interface {
	Handler(next FnHandler) FnHandler
}

type FnHandlerMiddlewares

type FnHandlerMiddlewares []FnHandlerMiddleware

func (FnHandlerMiddlewares) Handler

func (middlewares FnHandlerMiddlewares) Handler(handler FnHandler) FnHandler

Jump to

Keyboard shortcuts

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