Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorAPIRegisted2 = errutil.NewFactory("API already registed for method=%q pattern=%q")
)
errors
Functions ¶
This section is empty.
Types ¶
type Definition ¶
type Definition struct { Version uint8 Name string FullName string Description string Method string Pattern string Handlers []interface{} Request interface{} Extra interface{} }
Definition contain API detail
type Manager ¶
type Manager struct { BasePackage string GetMethodPatternKey func(*Manager, Definition) string NameGenerator func(*Manager, Definition) (name string, fullname string) MethodGenerator func(*Manager, Definition) string PatternGenerator func(*Manager, Definition) string // contains filtered or unexported fields }
Manager manage all registed APIs
func NewManager ¶
func NewManager(basePackage interface{}) *Manager
NewManager create a new manager instance
func (*Manager) GetMethodPatternMap ¶
func (t *Manager) GetMethodPatternMap() map[string]Definition
GetMethodPatternMap return string definition map, key := method pattern
func (*Manager) GetSortedAPIsByPkgPath ¶
func (t *Manager) GetSortedAPIsByPkgPath() (results []Definition)
GetSortedAPIsByPkgPath return all registed APIs sorted by package path NOTE: this is slow for sorting in runtime
Click to show internal directories.
Click to hide internal directories.