router

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level1Router

type Level1Router[Route comparable, Handle any] struct {
	// contains filtered or unexported fields
}

Level1Router 支持一级分类的路由器

func NewLevel1Router

func NewLevel1Router[Route comparable, Handle any]() *Level1Router[Route, Handle]

func (*Level1Router[Route, Handle]) Match

func (slf *Level1Router[Route, Handle]) Match(route Route) Handle

func (*Level1Router[Route, Handle]) Route

func (slf *Level1Router[Route, Handle]) Route(route Route, handleFunc Handle)

type Level2Router

type Level2Router[Route comparable, Handle any] struct {
	// contains filtered or unexported fields
}

Level2Router 支持二级分类的路由器

func NewLevel2Router

func NewLevel2Router[Route comparable, Handle any]() *Level2Router[Route, Handle]

func (*Level2Router[Route, Handle]) Match

func (slf *Level2Router[Route, Handle]) Match(topRoute Route, route Route) Handle

func (*Level2Router[Route, Handle]) Route

func (slf *Level2Router[Route, Handle]) Route(topRoute Route, route Route, handleFunc Handle)

type Level3Router

type Level3Router[Route comparable, Handle any] struct {
	// contains filtered or unexported fields
}

Level3Router 支持三级分类的路由器

func NewLevel3Router

func NewLevel3Router[Route comparable, Handle any]() *Level3Router[Route, Handle]

func (*Level3Router[Route, Handle]) Match

func (slf *Level3Router[Route, Handle]) Match(topRoute Route, level2Route Route, route Route) Handle

func (*Level3Router[Route, Handle]) Route

func (slf *Level3Router[Route, Handle]) Route(topRoute Route, level2Route Route, route Route, handleFunc Handle)

Jump to

Keyboard shortcuts

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