Documentation ¶
Index ¶
- Constants
- type Adapter
- type AppendHeader
- type Caller
- type CallerTrace
- type Content
- type ContentType
- type Context
- type Cookie
- type Empty
- type Entry
- type Error
- type Flusher
- type HandlerOrder
- type Header
- type HttpMethod
- type HttpStatus
- type Int
- type Int16
- type Int16Req
- type Int32
- type Int32Req
- type Int64
- type Int64Req
- type Int8
- type Int8Req
- type IntReq
- type Match
- type MethodInfo
- type MethodsPools
- type MiddleWare
- type Option
- type Param
- type ParamWarp
- type ReadHeader
- type Request
- type RetAdapter
- type Serialize
- type String
- type StringReq
- type SwaggerOps
- type SwaggerSecurity
- type WriteHeader
Constants ¶
View Source
const ( Content_Type = "Content-Type" Content_Encoding = "Content-Encoding" Content_JSON = "application/json" CONTENT_STREAM = "application/octet-stream" CONTENT_HTML = "text/html" HEAD_CONST = "_API_HEADER_TYPE_" CONTENT_DISPOSITION = "Content-Disposition" )
View Source
const ( Handler_API = HandlerOrder(100) Handler_GZIP = HandlerOrder(98) Handler_STATIC = HandlerOrder(99) Handler_NOTFIND = HandlerOrder(1000) )
HandlerOrder 0-100 system 100-1000 user
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppendHeader ¶
type AppendHeader interface {
Append(header ReadHeader) map[string]string
}
AppendHeader used in retType
type CallerTrace ¶ added in v0.1.0
type CallerTrace interface { Before() bool After() }
type Context ¶ added in v0.1.0
type Context struct { Match Match Pool *MethodsPools Caller Caller Serialize Serialize }
var DefaultContext *Context
type Error ¶
func NewErrorCode ¶
type HandlerOrder ¶ added in v0.1.0
type HandlerOrder uint
type Header ¶
type Header interface { Cookie ReadHeader WriteHeader }
Header used in param eg. *
GET(func(a def.Header) interface{} { return a.Values("Accept-Encoding") }, "/h")
type HttpMethod ¶ added in v0.1.0
type HttpStatus ¶
type HttpStatus interface {
Code() int
}
type Int ¶ added in v0.1.0
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type Int16 ¶ added in v0.1.0
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type Int16Req ¶
type Int16Req Int16[int16]
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type Int32 ¶ added in v0.1.0
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type Int32Req ¶
type Int32Req Int32[int32]
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type Int64 ¶ added in v0.1.0
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type Int64Req ¶
type Int64Req Int64[int64]
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type Int8 ¶ added in v0.1.0
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type Int8Req ¶
type Int8Req Int8[int8]
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type IntReq ¶
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type MethodInfo ¶
type MethodsPools ¶ added in v0.1.0
type MethodsPools struct { utils.Map[string, *MethodInfo] }
func (*MethodsPools) FuncInfo ¶ added in v0.1.0
func (m *MethodsPools) FuncInfo(fn any) *MethodInfo
type MiddleWare ¶ added in v0.1.0
MiddleWare If ret == nil The next MiddleWare will continue if ret != nil Ret will be used as the result
type Option ¶ added in v0.1.0
type Option interface { SetContext(ctx *Context) Option SetMethod(md *MethodInfo) Option StoreKV(key string, v any) Swagger(opsFn func(swagger SwaggerOps)) Option SetMiddleware(m ...MiddleWare) Option Path() string Method() string }
type Request ¶ added in v0.1.0
func WithRequest ¶ added in v0.1.0
func WithRequest(rw http.ResponseWriter, req *http.Request) *Request
func (*Request) ResponseWriter ¶ added in v0.1.0
func (r *Request) ResponseWriter() http.ResponseWriter
type RetAdapter ¶
type RetAdapter interface { ContentType Return() io.Reader Register() []reflect.Type }
type String ¶ added in v0.1.0
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type StringReq ¶
type StringReq String[string]
require param *
//b is require GET(func(a int, b def.StringReq) { fmt.Println(a, b) }, "/require")
type SwaggerOps ¶ added in v0.1.0
type SwaggerOps interface { SwaggerSecurity SetSummary(title string) SetTag(tag string) SetDescription(description string) SetParameterDescription(name, description string) }
type SwaggerSecurity ¶ added in v0.1.0
type WriteHeader ¶
type WriteHeader interface {
Add(key, value string)
}
Click to show internal directories.
Click to hide internal directories.