Documentation ¶
Index ¶
- Constants
- func BindFile(f File, s any) (map[string][]*DataFile, any)
- func GetTagParamIndex(v string) (int, string)
- func GetTagParams(v string) []string
- func NewEvent() *event
- func ResolveWSEventname(e string) (string, string)
- type Body
- type Context
- func (c *Context) Body() Body
- func (c *Context) File() File
- func (c *Context) Form() Form
- func (c *Context) GetID() string
- func (c *Context) GetRoute() string
- func (c *Context) GetType() string
- func (c *Context) Header() Header
- func (c *Context) JSON(data ...any)
- func (c *Context) JSONP(data ...any)
- func (c *Context) Param() Param
- func (c *Context) Query() Query
- func (c *Context) Redirect(url string)
- func (c *Context) Reset()
- func (c *Context) SetID(id string) *Context
- func (c *Context) SetRoute(route string) *Context
- func (c *Context) SetType(t string) *Context
- func (c *Context) Status(code int) *Context
- func (c *Context) Text(data string, args ...any)
- type DataFile
- type DataWriter
- type ErrFn
- type FieldLevel
- func (fl *FieldLevel) Field() string
- func (fl *FieldLevel) Index() int
- func (fl *FieldLevel) IsValue() bool
- func (fl *FieldLevel) Kind() reflect.Kind
- func (fl *FieldLevel) Namespace() string
- func (fl *FieldLevel) NestedTag() string
- func (fl *FieldLevel) Tag() string
- func (fl *FieldLevel) Type() reflect.Type
- func (fl *FieldLevel) Value() any
- type File
- type Form
- type Handler
- type Header
- type JSON
- type JSONP
- type Map
- type Next
- type Param
- type Query
- type Redirect
- type Text
- type WS
- func (ws *WS) CanEstablish(insertedEvents map[string]string) bool
- func (ws *WS) GetConnID() string
- func (ws *WS) GetSubprotocol() string
- func (ws *WS) GetSubscribedEvents() []string
- func (ws *WS) SendSelf(c *Context, message any) error
- func (ws *WS) SendToConn(c *Context, wsConn *websocket.Conn, message string) error
- type WSMessage
- type WSPayload
Constants ¶
View Source
const ( HTTPType = "http" WSType = "ws" RPCType = "rpc" GQLType = "gql" )
View Source
const ( REQUEST_FINISHED = "REQUEST_FINISHED" CATCH_EXCEPTION = "CATCH_EXCEPTION" )
View Source
const (
REQUEST_ID = "X-Request-Id"
)
header keys
View Source
const (
TagBind = "bind"
)
Variables ¶
This section is empty.
Functions ¶
func GetTagParamIndex ¶
func GetTagParams ¶
func ResolveWSEventname ¶
Types ¶
type Context ¶
type Context struct { *http.Request http.ResponseWriter ParamKeys map[string][]int ParamValues []string ID string Type string Next Next Event *event Code int Timestamp time.Time // Extend context // WebSocket WS *WS // contains filtered or unexported fields }
func NewContext ¶
func NewContext() *Context
type DataWriter ¶
type DataWriter interface {
WriteData(int)
}
type FieldLevel ¶
type FieldLevel struct {
// contains filtered or unexported fields
}
func BindStrArr ¶
func BindStrArr(d map[string][]string, fls *[]FieldLevel, s any) (any, []FieldLevel)
func BindStruct ¶
func BindStruct(d map[string]any, fls *[]FieldLevel, s any, parentNS string, parentTag string) (any, []FieldLevel)
func (*FieldLevel) Field ¶
func (fl *FieldLevel) Field() string
func (*FieldLevel) Index ¶
func (fl *FieldLevel) Index() int
func (*FieldLevel) IsValue ¶
func (fl *FieldLevel) IsValue() bool
func (*FieldLevel) Kind ¶
func (fl *FieldLevel) Kind() reflect.Kind
func (*FieldLevel) Namespace ¶
func (fl *FieldLevel) Namespace() string
func (*FieldLevel) NestedTag ¶
func (fl *FieldLevel) NestedTag() string
func (*FieldLevel) Tag ¶
func (fl *FieldLevel) Tag() string
func (*FieldLevel) Type ¶
func (fl *FieldLevel) Type() reflect.Type
func (*FieldLevel) Value ¶
func (fl *FieldLevel) Value() any
type File ¶
type File map[string][]*multipart.FileHeader
type WS ¶
type WS struct { Connection *websocket.Conn Message WSMessage // contains filtered or unexported fields }
func (*WS) GetSubprotocol ¶
func (*WS) GetSubscribedEvents ¶
Click to show internal directories.
Click to hide internal directories.