wrapper

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouterWrapper

type RouterWrapper struct {
	Router *mux.Router

	SubPath string
	Methods []string
	Handler http.HandlerFunc

	Children []*RouterWrapper
	Parent   *RouterWrapper
}

RouterWrapper wraps router with tree structure

func New

func New(path string, methods []string, handler http.HandlerFunc) *RouterWrapper

New is a constructor for the RouterWrapper

func (*RouterWrapper) Add

func (w *RouterWrapper) Add(child *RouterWrapper) error

Add adds child as a child (child node of a tree) of w

func (*RouterWrapper) FullPath

func (w *RouterWrapper) FullPath() string

FullPath builds full path string of the api

Jump to

Keyboard shortcuts

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