Documentation ¶
Index ¶
Constants ¶
View Source
const ( APITagName = "name" APITagDesc = "desc" APITagFormat = "format" APITagIgnore = "-" )
Variables ¶
View Source
var Validator = &defaultValidator{}
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 Params []ParamOpt }
Route is the options of route.
type RouteAPIOption ¶ added in v0.6.6
type RouteAPIOption struct {
// contains filtered or unexported fields
}
type RouteAPIOpts ¶ added in v0.6.6
type RouteAPIOpts func(*RouteAPIOption)
func WithLogger ¶ added in v0.6.6
func WithLogger(logger *slog.Logger) RouteAPIOpts
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 ExtraPathDocs ¶
ExtraPathDocs sets extra descriptions for path params.
func RouteAPI ¶ added in v0.5.0
func RouteAPI(f any, opts ...RouteAPIOpts) RouteFunc
func RouteErrors ¶
RouteErrors defines the errors of a route.
type Run ¶
type Run struct { BeforeShutDown func() AfterShutDown func() AfterStart func() Ctx context.Context Cancel context.CancelFunc }
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 AfterStart ¶ added in v0.5.9
func AfterStart(f func()) RunFunc
func BeforeShutDown ¶
func BeforeShutDown(f func()) RunFunc
BeforeShutDown will run before http server shuts down.
func WithContext ¶ added in v0.4.4
func WithContext(ctx context.Context, cancel context.CancelFunc) RunFunc
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.
Click to show internal directories.
Click to hide internal directories.