Documentation
¶
Overview ¶
Package router implements the router
Index ¶
- func ConvertRouteToRouteName(route string) (string, error)
- type HandlerFn
- type Middlewares
- type Mux
- func (m *Mux) Connect(ri *RouteInfo, handlerFn HandlerFn)
- func (m *Mux) Delete(ri *RouteInfo, handlerFn HandlerFn)
- func (m *Mux) Get(ri *RouteInfo, handlerFn HandlerFn)
- func (m *Mux) Handle(ri *RouteInfo, handler http.Handler)
- func (m *Mux) HandleFunc(ri *RouteInfo, handlerFn HandlerFn)
- func (m *Mux) Head(ri *RouteInfo, handlerFn HandlerFn)
- func (m *Mux) Method(ri *RouteInfo, handler http.Handler)
- func (m *Mux) MethodFunc(ri *RouteInfo, handlerFn HandlerFn)
- func (m *Mux) Options(ri *RouteInfo, handlerFn HandlerFn)
- func (m *Mux) Patch(ri *RouteInfo, handlerFn HandlerFn)
- func (m *Mux) Post(ri *RouteInfo, handlerFn HandlerFn)
- func (m *Mux) Put(ri *RouteInfo, handlerFn HandlerFn)
- func (m *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *Mux) Trace(ri *RouteInfo, handlerFn HandlerFn)
- func (m *Mux) Use(middlewares ...func(http.Handler) http.Handler)
- type RouteCache
- type RouteCacheOpt
- type RouteCacher
- type RouteInfo
- type RouteInfoOpt
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertRouteToRouteName ¶
Types ¶
type Middlewares ¶
type Middlewares []func(http.ResponseWriter, *http.Request)
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
func (*Mux) HandleFunc ¶
func (*Mux) MethodFunc ¶
type RouteCache ¶
type RouteCache struct {
// contains filtered or unexported fields
}
func NewRouteCacheService ¶
func NewRouteCacheService(opts ...RouteCacheOpt) (*RouteCache, error)
func (*RouteCache) AddRouteInfo ¶
func (r *RouteCache) AddRouteInfo(routeInfo *RouteInfo) error
func (*RouteCache) GetRouteInfo ¶
func (r *RouteCache) GetRouteInfo(name string) (*RouteInfo, error)
type RouteCacheOpt ¶
type RouteCacheOpt func(*RouteCache)
func WithStore ¶
func WithStore(store storage.Storer) RouteCacheOpt
func WithTTL ¶
func WithTTL(ttl time.Duration) RouteCacheOpt
type RouteCacher ¶
type RouteInfo ¶
func NewRouteInfo ¶
func NewRouteInfo(opts ...RouteInfoOpt) (*RouteInfo, error)
type RouteInfoOpt ¶
type RouteInfoOpt func(r *RouteInfo)
func Description ¶
func Description(description string) RouteInfoOpt
func Method ¶
func Method(method string) RouteInfoOpt
func Name ¶
func Name(name string) RouteInfoOpt
func Path ¶
func Path(path string) RouteInfoOpt
func Title ¶
func Title(title string) RouteInfoOpt
type Router ¶
type Router interface { Handle(ri *RouteInfo, handler http.Handler) HandleFunc(ri *RouteInfo, handlerFn HandlerFn) Method(ri *RouteInfo, handler http.Handler) MethodFunc(ri *RouteInfo, handlerFn HandlerFn) Get(ri *RouteInfo, handlerFn HandlerFn) Post(ri *RouteInfo, handlerFn HandlerFn) Put(ri *RouteInfo, handlerFn HandlerFn) Delete(ri *RouteInfo, handlerFn HandlerFn) Patch(ri *RouteInfo, handlerFn HandlerFn) Options(ri *RouteInfo, handlerFn HandlerFn) Head(ri *RouteInfo, handlerFn HandlerFn) Trace(ri *RouteInfo, handlerFn HandlerFn) Connect(ri *RouteInfo, handlerFn HandlerFn) }
Click to show internal directories.
Click to hide internal directories.