opt

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2018 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Route

type Route struct {
	ID                string
	To                func(ctx box.Ctx)
	Auth              bool
	Errors            map[int]string
	EnableAutoPathDoc bool
	ExtraPathDocs     []string
}

Route is the options of route.

type RouteFunc

type RouteFunc func(*Route)

RouteFunc is the type of route options functions.

func DisableAuthPathDoc

func DisableAuthPathDoc() RouteFunc

DisableAuthPathDoc disables auto generate path param docs for route.

func EnableAuth

func EnableAuth() RouteFunc

EnableAuth enables JWT auth for a route.

func ExtraPathDocs

func ExtraPathDocs(docs ...string) RouteFunc

ExtraPathDocs sets extra descriptions for path params.

func RouteErrors

func RouteErrors(m map[int]string) RouteFunc

RouteErrors defines the errors of a route.

func RouteID

func RouteID(id string) RouteFunc

RouteID sets the ID of a route.

func RouteTo

func RouteTo(f func(ctx box.Ctx)) RouteFunc

RouteTo binds a function to a route.

type Run

type Run struct {
	BeforeShutDown func()
	AfterShutDown  func()
}

Run is the running options of container.

type RunFunc

type RunFunc func(*Run)

RunFunc is the type of running config functions.

func AfterShutDown

func AfterShutDown(f func()) RunFunc

AfterShutDown will run after http server shuts down.

func BeforeShutDown

func BeforeShutDown(f func()) RunFunc

BeforeShutDown will run before http server shuts down.

type Services

type Services struct {
	Filters []restful.FilterFunction
	Errors  map[int]string
}

Services is the options for biu.AddServices.

type ServicesFunc

type ServicesFunc func(*Services)

ServicesFunc is the type of biu.AddServices options.

func Filters

func Filters(filters ...restful.FilterFunction) ServicesFunc

Filters sets a list of filters for all services.

func ServiceErrors

func ServiceErrors(errors map[int]string) ServicesFunc

ServiceErrors declares the global errors for services.

type ServicesFuncArr

type ServicesFuncArr []ServicesFunc

ServicesFuncArr is a slice of Services Functions.

Jump to

Keyboard shortcuts

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