router

package
v0.0.0-...-b216bee Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const GIN string = "gin"
View Source
const MUX string = "mux"

Variables

This section is empty.

Functions

This section is empty.

Types

type RouteGin

type RouteGin struct {
	Method  string
	Path    string
	Handler func(*gin.Context)
}

type RouteMux

type RouteMux struct {
	Method  string
	Path    string
	Handler func(w http.ResponseWriter, r *http.Request)
}

type Router

type Router interface {
	Get(path string, handleFunc interface{})
	Post(path string, handleFunc interface{})
	Put(path string, handleFunc interface{})
	Patch(path string, handleFunc interface{})
	Delete(path string, handleFunc interface{})
	Options(path string, handleFunc interface{})
	Run(port int) error
	UseMiddleware(middleware interface{})
}

func New

func New(routerType string) (Router, error)

type RouterGin

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

func NewginRouter

func NewginRouter() *RouterGin

func (*RouterGin) Delete

func (r *RouterGin) Delete(path string, handleFunc interface{})

func (*RouterGin) Get

func (r *RouterGin) Get(path string, handleFunc interface{})

func (*RouterGin) Options

func (r *RouterGin) Options(path string, handleFunc interface{})

func (*RouterGin) Patch

func (r *RouterGin) Patch(path string, handleFunc interface{})

func (*RouterGin) Post

func (r *RouterGin) Post(path string, handleFunc interface{})

func (*RouterGin) Put

func (r *RouterGin) Put(path string, handleFunc interface{})

func (*RouterGin) Run

func (r *RouterGin) Run(port int) error

func (*RouterGin) UseMiddleware

func (r *RouterGin) UseMiddleware(middleware interface{})

type RouterMux

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

func NewMuxRouter

func NewMuxRouter() *RouterMux

func (*RouterMux) Delete

func (r *RouterMux) Delete(path string, handleFunc interface{})

func (*RouterMux) Get

func (r *RouterMux) Get(path string, handleFunc interface{})

func (*RouterMux) Options

func (r *RouterMux) Options(path string, handleFunc interface{})

func (*RouterMux) Patch

func (r *RouterMux) Patch(path string, handleFunc interface{})

func (*RouterMux) Post

func (r *RouterMux) Post(path string, handleFunc interface{})

func (*RouterMux) Put

func (r *RouterMux) Put(path string, handleFunc interface{})

func (*RouterMux) Run

func (r *RouterMux) Run(port int) error

func (*RouterMux) UseMiddleware

func (r *RouterMux) UseMiddleware(middleware interface{})

Jump to

Keyboard shortcuts

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