Documentation ¶
Index ¶
- Variables
- func AddMiddleware(mwf ...func(http.Handler) http.Handler)
- func AddRoute(route ...model.Route)
- func BodyMaxBytes(n int64) func(inner http.Handler) http.Handler
- func BulkHead(workers int, maxWaitTime time.Duration) func(inner http.Handler) http.Handler
- func CallbackOnChange(listener *httpConfigListener) func(event *configmgr.NacosChangeEvent)
- func InitialiseRemoteConfigListener()
- func NewHttpConfigListener() *httpConfigListener
- func PreMiddleware(mwf ...func(http.Handler) http.Handler)
- func RegisterCustomTypeFunc(fn form.DecodeCustomTypeFunc, types ...interface{})
- func Run(services ...interface{})
- type HttpMethod
Constants ¶
This section is empty.
Variables ¶
View Source
var RunnerChain = goresilience.RunnerChain
Functions ¶
func AddMiddleware ¶
AddMiddleware adds middlewares to the end of chain
func BulkHead ¶
BulkHead add bulk head pattern middleware based on https://github.com/slok/goresilience workers is the number of workers in the execution pool. maxWaitTime is the max time an incoming request will wait to execute before being dropped its execution and return 429 response.
func CallbackOnChange ¶
func CallbackOnChange(listener *httpConfigListener) func(event *configmgr.NacosChangeEvent)
func InitialiseRemoteConfigListener ¶
func InitialiseRemoteConfigListener()
func NewHttpConfigListener ¶
func NewHttpConfigListener() *httpConfigListener
func PreMiddleware ¶
PreMiddleware adds middlewares to the head of chain
func RegisterCustomTypeFunc ¶
func RegisterCustomTypeFunc(fn form.DecodeCustomTypeFunc, types ...interface{})
Types ¶
type HttpMethod ¶
type HttpMethod int
const ( UNKNOWN HttpMethod = iota POST GET PUT DELETE )
func (HttpMethod) MarshalJSON ¶
func (k HttpMethod) MarshalJSON() ([]byte, error)
func (*HttpMethod) StringGetter ¶
func (k *HttpMethod) StringGetter() string
func (*HttpMethod) StringSetter ¶
func (k *HttpMethod) StringSetter(value string)
func (*HttpMethod) UnmarshalJSON ¶
func (k *HttpMethod) UnmarshalJSON(bytes []byte) error
Click to show internal directories.
Click to hide internal directories.