Documentation
¶
Index ¶
- func GetPool[REQ ReqCtx]() sync.Pool
- func GetToken[REQ ReqCtx](r REQ) string
- type Auth
- type AuthInfo
- type AuthInterface
- type Context
- func (c *Context[REQ]) Device() *DeviceInfo
- func (c *Context[REQ]) Method() string
- func (c *Context[REQ]) SendHeader(md metadata.MD) error
- func (c *Context[REQ]) SetCookie(v string) error
- func (c *Context[REQ]) SetHeader(md metadata.MD) error
- func (c *Context[REQ]) SetTrailer(md metadata.MD) error
- func (c *Context[REQ]) StartSpanX(name string, o ...trace.SpanStartOption) (*Context[REQ], trace.Span)
- func (c *Context[REQ]) Wrapper() context.Context
- type DeviceInfo
- type ReqCtx
- type ReqValue
- type RequestAt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthInterface ¶ added in v0.2.0
type Context ¶
func (*Context[REQ]) Device ¶ added in v0.2.0
func (c *Context[REQ]) Device() *DeviceInfo
func (*Context[REQ]) SendHeader ¶ added in v0.2.0
func (*Context[REQ]) SetTrailer ¶ added in v0.2.0
func (*Context[REQ]) StartSpanX ¶
type DeviceInfo ¶
type DeviceInfo struct { //设备 Device string `json:"device" gorm:"size:255"` OS string `json:"os" gorm:"size:255"` AppCode string `json:"appCode" gorm:"size:255"` AppVer string `json:"appVer" gorm:"size:255"` IP string `json:"ip" gorm:"size:255"` Lng float64 `json:"lng" gorm:"type:numeric(10,6)"` Lat float64 `json:"lat" gorm:"type:numeric(10,6)"` Area string `json:"area" gorm:"size:255"` UserAgent string `json:"userAgent" gorm:"size:255"` }
func Device ¶
func Device(infoHeader, area, location, userAgent, ip string) *DeviceInfo
info: device,os,appCode,appVersion area:xxx location:1.23456,2.123456
type RequestAt ¶ added in v0.2.0
func NewRequestAt ¶ added in v0.2.0
func NewRequestAt() RequestAt
func NewRequestAtFromTime ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.