dtype

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_map_slice_proto protoreflect.FileDescriptor

Functions

func BoolPtr

func BoolPtr(b bool) *bool

func Copy

func Copy(fromValue, toValue interface{})

Copy copy things

func CopyTo added in v0.7.0

func CopyTo[T any](fromValue any) T

func CopyToPtr added in v0.7.0

func CopyToPtr[T any](fromValue any) *T

func DeepFieldTypes

func DeepFieldTypes(p interface{}) []reflect.StructField

func GetTotalPages

func GetTotalPages(total int64, perPage int) int

func NewPtr added in v0.8.0

func NewPtr[T any]() *T

func TimePtr

func TimePtr(t time.Time) *time.Time

Types

type H

type H = map[string]interface{}

type MapStringSlicePb

type MapStringSlicePb struct {
	MapValue map[string]*StringSlicePb `` /* 173-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*MapStringSlicePb) Descriptor deprecated

func (*MapStringSlicePb) Descriptor() ([]byte, []int)

Deprecated: Use MapStringSlicePb.ProtoReflect.Descriptor instead.

func (*MapStringSlicePb) GetMapValue

func (x *MapStringSlicePb) GetMapValue() map[string]*StringSlicePb

func (*MapStringSlicePb) ProtoMessage

func (*MapStringSlicePb) ProtoMessage()

func (*MapStringSlicePb) ProtoReflect

func (x *MapStringSlicePb) ProtoReflect() protoreflect.Message

func (*MapStringSlicePb) Reset

func (x *MapStringSlicePb) Reset()

func (*MapStringSlicePb) Scan

func (m *MapStringSlicePb) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*MapStringSlicePb) String

func (x *MapStringSlicePb) String() string

type MultiInputs

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

func MakeMultiInputs added in v0.7.0

func MakeMultiInputs(args ...interface{}) *MultiInputs

func (*MultiInputs) Add

func (mi *MultiInputs) Add(input interface{})

func (*MultiInputs) Bind added in v0.7.0

func (mi *MultiInputs) Bind(in interface{}) interface{}

type Number

type Number interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
}

type PageParams

type PageParams struct {
	PerPage int `query:"per_page"`
	PageNum int `query:"page_number"`
}

func (*PageParams) SetDefault added in v0.7.0

func (p *PageParams) SetDefault(defaultPerPage int)

func (*PageParams) Valid added in v0.7.0

func (p *PageParams) Valid() bool

type PageResult

type PageResult struct {
	PerPage    int
	PageNum    int
	Total      int64
	TotalPages int
}

func NewPageResult

func NewPageResult(perPage, pageNum int, total int64) PageResult

NewPageResult 根据输入生成page,一般由于数据库操作时用了offset等操作,total和len(data)不一致 perPage: 每页数量 pageNum: 当前页 total: 总数

func (PageResult) Json

func (p PageResult) Json(key string, data interface{}) map[string]interface{}

type StringSliceMap

type StringSliceMap map[string][]string

func (StringSliceMap) HaveIntersection

func (n StringSliceMap) HaveIntersection(key string, input StringSliceMap) bool

func (*StringSliceMap) Scan

func (n *StringSliceMap) Scan(value interface{}) error

Scan implements the Scanner interface.

func (StringSliceMap) Value

func (n StringSliceMap) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type StringSlicePb

type StringSlicePb struct {
	Value []string `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*StringSlicePb) Descriptor deprecated

func (*StringSlicePb) Descriptor() ([]byte, []int)

Deprecated: Use StringSlicePb.ProtoReflect.Descriptor instead.

func (*StringSlicePb) GetValue

func (x *StringSlicePb) GetValue() []string

func (*StringSlicePb) ProtoMessage

func (*StringSlicePb) ProtoMessage()

func (*StringSlicePb) ProtoReflect

func (x *StringSlicePb) ProtoReflect() protoreflect.Message

func (*StringSlicePb) Reset

func (x *StringSlicePb) Reset()

func (*StringSlicePb) String

func (x *StringSlicePb) String() string

type Time

type Time timestamp.Timestamp

func FromStdTime

func FromStdTime(t time.Time) Time

func Now

func Now() Time

func NowPtr

func NowPtr() *Time

func (*Time) AsTime

func (n *Time) AsTime() time.Time

func (*Time) Marshal

func (n *Time) Marshal() ([]byte, error)

func (Time) MarshalJSON

func (n Time) MarshalJSON() ([]byte, error)

func (*Time) Scan

func (n *Time) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*Time) Unmarshal

func (n *Time) Unmarshal(data []byte) error

func (*Time) UnmarshalJSON

func (n *Time) UnmarshalJSON(b []byte) error

func (Time) Value

func (n Time) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Jump to

Keyboard shortcuts

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