wrapper

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 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 interface {
	Add(child *Wrapper) error
	FullPath() string

	Router() *mux.Router
	SetRouter(*mux.Router)

	Children() []RouterWrapper

	Handler() http.HandlerFunc
}

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 *Wrapper) 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

func (*Wrapper) FullPath

func (w *Wrapper) FullPath() string

FullPath builds full path string of the api

func (*Wrapper) Handler

func (w *Wrapper) Handler() http.HandlerFunc

func (*Wrapper) Router

func (w *Wrapper) Router() *mux.Router

Router returns its router

func (*Wrapper) SetRouter

func (w *Wrapper) SetRouter(r *mux.Router)

SetRouter sets its router

Jump to

Keyboard shortcuts

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