router

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Handling = "Handling"
	Handler  = "Handle"
	Handled  = "Handled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	Path     string //原始注册服务路径
	Handling middleware.Handler
	Handled  middleware.Handler
	Children map[string]*Group
	Services map[string]*Unit
	// contains filtered or unexported fields
}

func ReflectHandle

func ReflectHandle(rootPath, path string, obj interface{}, method ...string) (*Group, error)

反射获取对象的Handle 方法

func (*Group) AddHandle

func (g *Group) AddHandle(subName string, handler middleware.Handler)

func (*Group) AddHandled

func (g *Group) AddHandled(subName string, handler middleware.Handler)

func (*Group) AddHandling

func (g *Group) AddHandling(subName string, handler middleware.Handler)

func (*Group) GetChild

func (g *Group) GetChild(name string) *Group

func (*Group) GetReallyPath

func (g *Group) GetReallyPath() string

func (*Group) HasChildren

func (g *Group) HasChildren() bool

func (*Group) HasService

func (g *Group) HasService() bool

func (*Group) IsValid

func (g *Group) IsValid() error

type Unit

type Unit struct {
	Name     string
	Handling middleware.Handler
	Handled  middleware.Handler
	Handle   middleware.Handler
	Group    *Group
}

Jump to

Keyboard shortcuts

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