Documentation ¶
Overview ¶
Router
* 2 * @Author: Nico 3 * @Date: 2020/11/8 17:53 4
Index ¶
- type ContentType
- type Driver
- type HandlerFunc
- type JSON
- type Mapping
- type Method
- type Option
- type Serial
- type Validator
- type Zeta
- func (z *Zeta) Complete()
- func (r Zeta) Group(url string, middleware ...HandlerFunc) *group
- func (r Zeta) Handle(method Method, url string, middleware ...HandlerFunc) *router
- func (r Zeta) Mappings() []Mapping
- func (r Zeta) Middleware() []HandlerFunc
- func (r Zeta) Option(z *Zeta)
- func (z *Zeta) Options(options ...Option) *Zeta
- func (z *Zeta) Run(addr ...string) error
- func (r Zeta) Use(middleware ...HandlerFunc) *router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentType ¶
type ContentType string
const ( ContentTypePostForm ContentType = "application/x-www-form-urlencoded" ContentTypeFormData ContentType = "multipart/form-data" ContentTypeJSON ContentType = "application/json" ContentTypeXML ContentType = "application/xml" )
type HandlerFunc ¶
type HandlerFunc interface{}
type JSON ¶
type JSON interface { Marshal(v interface{}) ([]byte, error) Unmarshal(data []byte, v interface{}) error }
func DefaultJSON ¶
func DefaultJSON() JSON
type Mapping ¶ added in v1.0.4
type Mapping struct {
// contains filtered or unexported fields
}
func (*Mapping) Middleware ¶ added in v1.0.4
func (m *Mapping) Middleware() []HandlerFunc
type Serial ¶
type Serial interface { Serial(dest interface{}) string DeSerial(src interface{}, t reflect.Type) (interface{}, error) }
func DefaultSerial ¶
type Validator ¶
type Validator interface {
Validate(s interface{}) error
}
func DefaultValidator ¶
func DefaultValidator() Validator
type Zeta ¶ added in v1.0.2
func (Zeta) Group ¶ added in v1.0.4
func (r Zeta) Group(url string, middleware ...HandlerFunc) *group
func (Zeta) Handle ¶ added in v1.0.4
func (r Zeta) Handle(method Method, url string, middleware ...HandlerFunc) *router
func (Zeta) Middleware ¶ added in v1.0.4
func (r Zeta) Middleware() []HandlerFunc
func (Zeta) Use ¶ added in v1.0.2
func (r Zeta) Use(middleware ...HandlerFunc) *router
Click to show internal directories.
Click to hide internal directories.