Documentation ¶
Index ¶
- Constants
- func FuncName(i interface{}) (fname string)
- func IsExported(name string) bool
- func Join(paths ...string) (r string)
- func RouteName(name string) string
- func ValueOf(i interface{}) reflect.Value
- type Node
- func (this *Node) Binder() interface{}
- func (this *Node) Call(args ...interface{}) (r []reflect.Value)
- func (this *Node) IsFunc() bool
- func (this *Node) IsMethod() bool
- func (this *Node) IsStruct() bool
- func (this *Node) Method() (fun interface{})
- func (this *Node) Name() string
- func (this *Node) Route() string
- func (this *Node) Value() reflect.Value
- type Registry
- func (this *Registry) Get(name string) (srv *Service, ok bool)
- func (this *Registry) Has(name string) (ok bool)
- func (this *Registry) Len() int
- func (this *Registry) Match(paths ...string) (node *Node, ok bool)
- func (this *Registry) Merge(r *Registry) (err error)
- func (this *Registry) Nodes(f func(node *Node) bool)
- func (this *Registry) Range(f func(service *Service) bool)
- func (this *Registry) Router() *Router
- func (this *Registry) Service(name string) *Service
- type Router
- func (this *Router) Handle() interface{}
- func (this *Router) Match(paths ...string) (nodes []*Router)
- func (this *Router) Params(paths ...string) map[string]string
- func (this *Router) Register(handle interface{}, paths ...string) (err error)
- func (this *Router) Route() (r []string)
- func (this *Router) String() string
- type Service
- func (this *Service) Merge(s *Service) (err error)
- func (this *Service) Name() string
- func (this *Service) Paths() (r []string)
- func (this *Service) Prefix() string
- func (this *Service) Range(f func(*Node) bool)
- func (this *Service) Register(i interface{}, prefix ...string) error
- func (this *Service) RegisterFun(i interface{}, prefix ...string) error
- func (this *Service) RegisterStruct(i interface{}, prefix ...string) error
Constants ¶
View Source
const ( PathMatchParam string = ":" PathMatchVague string = "*" )
Variables ¶
This section is empty.
Functions ¶
func IsExported ¶
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
type Router ¶ added in v0.0.3
type Router struct {
// contains filtered or unexported fields
}
type Service ¶
type Service struct { Handler interface{} //自定义 Filter等方法 Formatter func(string) string //格式化对象和方法名,默认强制小写 // contains filtered or unexported fields }
func NewService ¶
func (*Service) RegisterFun ¶
func (*Service) RegisterStruct ¶
RegisterStruct 注册一组handle
Click to show internal directories.
Click to hide internal directories.