router

package
v0.0.0-...-f85edf5 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Params map[string]string
}

type DynamicRoutePattern

type DynamicRoutePattern struct {
	// contains filtered or unexported fields
}

type Handler

type Handler func(http.ResponseWriter, *http.Request, *Context)

type Method

type Method int
const (
	ALL Method = iota
	GET
	POST
	PUT
	DELETE
)

func (Method) String

func (method Method) String() string

type Path

type Path string

func (*Path) GetRoutePattern

func (p *Path) GetRoutePattern() string

func (*Path) IsEqual

func (p *Path) IsEqual(path Path) bool

func (*Path) IsParam

func (p *Path) IsParam() bool

func (*Path) IsRoot

func (p *Path) IsRoot() bool

func (*Path) IsRouteValid

func (p *Path) IsRouteValid() (bool, error)

func (*Path) IsSubtreePath

func (p *Path) IsSubtreePath() bool

func (*Path) IsValid

func (p *Path) IsValid() (bool, error)

func (*Path) Merge

func (p *Path) Merge(path Path) Path

func (*Path) Split

func (p *Path) Split() []Path

func (*Path) String

func (p *Path) String() string

type Route

type Route struct {
	// contains filtered or unexported fields
}

type Router

type Router struct {
	// contains filtered or unexported fields
}

func New

func New(stringPath string) (*Router, error)

func (*Router) AddHandlersIntoServeMux

func (r *Router) AddHandlersIntoServeMux(serve *http.ServeMux)

func (*Router) All

func (r *Router) All(stringPath string, handler Handler) error

func (*Router) Delete

func (r *Router) Delete(stringPath string, handler Handler) error

func (*Router) Get

func (r *Router) Get(stringPath string, handler Handler) error

func (*Router) GetRoute

func (r *Router) GetRoute(path Path) *Route

func (*Router) Post

func (r *Router) Post(stringPath string, handler Handler) error

func (*Router) Put

func (r *Router) Put(stringPath string, handler Handler) error

func (*Router) Use

func (r *Router) Use(stringPath string, router *Router) error

Jump to

Keyboard shortcuts

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