x

package
v0.0.0-...-9a83fbb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanConvert

func CanConvert[FromType any, ToType any]() bool

CanConvert returns true if FromType can be converted to ToType.

func Ptr

func Ptr[T any](v T) *T

func ToUint

func ToUint(s string) uint64

func TypeOf

func TypeOf[T any]() reflect.Type

Types

type BigInt

type BigInt struct {
	// contains filtered or unexported fields
}

func NewBigInt

func NewBigInt(bigint *big.Int) BigInt

func ParseBigInt

func ParseBigInt(v string) BigInt

func (*BigInt) Int

func (bi *BigInt) Int() *big.Int

func (*BigInt) MarshalBSON

func (bi *BigInt) MarshalBSON() ([]byte, error)

func (*BigInt) MarshalJSON

func (bi *BigInt) MarshalJSON() ([]byte, error)

func (*BigInt) UnmarshalBSON

func (bi *BigInt) UnmarshalBSON(data []byte) error

func (*BigInt) UnmarshalJSON

func (bi *BigInt) UnmarshalJSON(data []byte) error

type PageAndSort

type PageAndSort struct {
	PageParam `json:",inline"` // 页码, 从1开始
	Sort      string           `json:"sort"` // 排序字段, 例如: -createdAt, +updatedAt
}

func NewPageAndSort

func NewPageAndSort(page, pageSize int64, sort string) *PageAndSort

new page and sort

func PageLimit

func PageLimit(limit int) *PageAndSort

func (*PageAndSort) IsDesc

func (p *PageAndSort) IsDesc() bool

is sorted by desc

type PageParam

type PageParam struct {
	Page     int64 `json:"page"`     // 页码, 从1开始
	PageSize int64 `json:"pageSize"` // 每页大小
}

func NewPageParam

func NewPageParam(page, pageSize int64) *PageParam

NewPageParam new pageparam

func (*PageParam) Limit

func (p *PageParam) Limit() int64

func (*PageParam) Skip

func (p *PageParam) Skip() int64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL