Documentation ¶
Index ¶
- Constants
- Variables
- func GetDataFromRequest(r *http.Request, v interface{}) error
- func GetRemoteIP(r *http.Request) string
- func ReadBody(r *http.Request) ([]byte, error)
- type PageRequest
- func (p *PageRequest) ComputeOffset() int64
- func (*PageRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PageRequest) GetOffset() int64
- func (x *PageRequest) GetPageNumber() uint64
- func (x *PageRequest) GetPageSize() uint64
- func (*PageRequest) ProtoMessage()
- func (x *PageRequest) ProtoReflect() protoreflect.Message
- func (x *PageRequest) Reset()
- func (x *PageRequest) String() string
Constants ¶
View Source
const ( // DefaultPageSize 默认分页大小 DefaultPageSize = 20 // DefaultPageNumber 默认页号 DefaultPageNumber = 1 )
Variables ¶
View Source
var ( // BodyMaxContenxLength body最大大小 默认64M BodyMaxContenxLength int64 = 1 << 26 )
View Source
var ( // DefaultScanForwareHeaderKey 协商forward ip 的 hander key名称 DefaultScanForwareHeaderKey = []string{"X-Forwarded-For", "X-Real-IP"} )
View Source
var File_mcube_pb_page_page_proto protoreflect.FileDescriptor
Functions ¶
func GetDataFromRequest ¶ added in v0.1.2
GetDataFromRequest todo
Types ¶
type PageRequest ¶
type PageRequest struct { PageSize uint64 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` PageNumber uint64 `protobuf:"varint,2,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"` Offset int64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // contains filtered or unexported fields }
func NewDefaultPageRequest ¶ added in v1.3.4
func NewDefaultPageRequest() *PageRequest
func NewPageRequest ¶ added in v0.1.2
func NewPageRequest(ps uint, pn uint) *PageRequest
NewPageRequest 实例化
func NewPageRequestFromHTTP ¶ added in v0.1.2
func NewPageRequestFromHTTP(req *http.Request) *PageRequest
NewPageRequestFromHTTP 从HTTP请求中加载分页请求
func (*PageRequest) ComputeOffset ¶ added in v1.5.8
func (p *PageRequest) ComputeOffset() int64
GetOffset skip 如果传入了offset则使用传入的offset参数
func (*PageRequest) Descriptor
deprecated
added in
v1.5.8
func (*PageRequest) Descriptor() ([]byte, []int)
Deprecated: Use PageRequest.ProtoReflect.Descriptor instead.
func (*PageRequest) GetOffset ¶ added in v0.6.6
func (x *PageRequest) GetOffset() int64
func (*PageRequest) GetPageNumber ¶ added in v1.5.8
func (x *PageRequest) GetPageNumber() uint64
func (*PageRequest) GetPageSize ¶ added in v1.5.8
func (x *PageRequest) GetPageSize() uint64
func (*PageRequest) ProtoMessage ¶ added in v1.5.8
func (*PageRequest) ProtoMessage()
func (*PageRequest) ProtoReflect ¶ added in v1.5.8
func (x *PageRequest) ProtoReflect() protoreflect.Message
func (*PageRequest) Reset ¶ added in v1.5.8
func (x *PageRequest) Reset()
func (*PageRequest) String ¶ added in v1.5.8
func (x *PageRequest) String() string
Click to show internal directories.
Click to hide internal directories.