Documentation ¶
Index ¶
- type RouterWrapper
- type Wrapper
- func (w *Wrapper) Add(child RouterWrapper) error
- func (w *Wrapper) Children() []RouterWrapper
- func (w *Wrapper) FullPath() string
- func (w *Wrapper) Handler() http.HandlerFunc
- func (w *Wrapper) Methods() []string
- func (w *Wrapper) Parent() RouterWrapper
- func (w *Wrapper) Router() *mux.Router
- func (w *Wrapper) SetParent(parent RouterWrapper)
- func (w *Wrapper) SetRouter(r *mux.Router)
- func (w *Wrapper) SubPath() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RouterWrapper ¶
type RouterWrapper interface { Add(child RouterWrapper) error FullPath() string Router() *mux.Router SetRouter(*mux.Router) Children() []RouterWrapper Parent() RouterWrapper SetParent(RouterWrapper) Handler() http.HandlerFunc SubPath() string Methods() []string }
RouterWrapper is an interface for wrapper
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper wraps router with tree structure
func New ¶
func New(path string, methods []string, handler http.HandlerFunc) *Wrapper
New is a constructor for the wrapper
func (*Wrapper) Add ¶
func (w *Wrapper) Add(child RouterWrapper) error
Add adds child as a child (child node of a tree) of w
func (*Wrapper) Children ¶
func (w *Wrapper) Children() []RouterWrapper
Children returns its children
Click to show internal directories.
Click to hide internal directories.