types

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arr2Pg

func Arr2Pg(arr []bool) pgtype.BoolArray

func Arr2Pg16

func Arr2Pg16(arr []int16) pgtype.Int2Array

func Arr2Pg32

func Arr2Pg32(arr []int32) pgtype.Int4Array

func Arr2Pg64

func Arr2Pg64(arr []int64) pgtype.Int8Array

func NewBool

func NewBool(b bool) *bool

func NewInt

func NewInt(i int) *int

func NewInt16

func NewInt16(i int16) *int16

func NewInt32

func NewInt32(i int32) *int32

func NewInt64

func NewInt64(i int64) *int64

func NewInt8

func NewInt8(i int8) *int8

func NewString

func NewString(i string) *string

func Pg2Arr

func Pg2Arr(v pgtype.BoolArray) []bool

func Pg2Arr16

func Pg2Arr16(v pgtype.Int2Array) []int16

func Pg2Arr32

func Pg2Arr32(v pgtype.Int4Array) []int32

func Pg2Arr64

func Pg2Arr64(v pgtype.Int8Array) []int64

Types

type Array

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

func ArrayOf

func ArrayOf(v ...interface{}) Array

func (Array) Value

func (a Array) Value() (driver.Value, error)

type AutoDateTime

type AutoDateTime struct {
	time.Time
}

datetime

func (AutoDateTime) MarshalJSON

func (t AutoDateTime) MarshalJSON() ([]byte, error)

func (*AutoDateTime) Scan

func (t *AutoDateTime) Scan(v interface{}) error

Scan valueof jstime.Time

func (*AutoDateTime) UnmarshalJSON

func (t *AutoDateTime) UnmarshalJSON(data []byte) error

func (AutoDateTime) Value

func (t AutoDateTime) Value() (driver.Value, error)

Value insert timestamp into mysql need this function.

type Date

type Date struct {
	time.Time
}

date

func NowDate

func NowDate() Date

func NowDateP added in v0.1.4

func NowDateP() *Date

func (Date) AddTime

func (d Date) AddTime(t Time) DateTime

func (Date) MarshalJSON

func (t Date) MarshalJSON() ([]byte, error)

func (*Date) Scan

func (t *Date) Scan(v interface{}) error

Scan valueof jstime.Time

func (Date) ToGoTime

func (t Date) ToGoTime() time.Time

func (*Date) UnmarshalJSON

func (t *Date) UnmarshalJSON(data []byte) error

func (Date) Value

func (t Date) Value() (driver.Value, error)

Value insert timestamp into mysql need this function.

type DateList

type DateList []Date

func (*DateList) Scan

func (p *DateList) Scan(data interface{}) error

Scan 实现方法

func (DateList) Value

func (p DateList) Value() (driver.Value, error)

gorm 自定义结构需要实现 Value Scan 两个方法 Value 实现方法

type DateTime

type DateTime struct {
	time.Time
}

datetime

func NowDateTime

func NowDateTime() DateTime

func NowDateTimeP added in v0.1.4

func NowDateTimeP() *DateTime

func (DateTime) MarshalJSON

func (t DateTime) MarshalJSON() ([]byte, error)

func (*DateTime) Scan

func (t *DateTime) Scan(v interface{}) error

Scan valueof jstime.Time

func (DateTime) ToGoTime

func (t DateTime) ToGoTime() time.Time

func (*DateTime) UnmarshalJSON

func (t *DateTime) UnmarshalJSON(data []byte) error

func (DateTime) Value

func (t DateTime) Value() (driver.Value, error)

Value insert timestamp into mysql need this function.

type DateTimeList

type DateTimeList []DateTime

func (*DateTimeList) Scan

func (p *DateTimeList) Scan(data interface{}) error

Scan 实现方法

func (DateTimeList) Value

func (p DateTimeList) Value() (driver.Value, error)

gorm 自定义结构需要实现 Value Scan 两个方法 Value 实现方法

type DecimalList

type DecimalList []decimal.Decimal

func (*DecimalList) Scan

func (p *DecimalList) Scan(data interface{}) error

Scan 实现方法

func (DecimalList) Value

func (p DecimalList) Value() (driver.Value, error)

gorm 自定义结构需要实现 Value Scan 两个方法 Value 实现方法

type Fields

type Fields []string

type IntList

type IntList []int

func (IntList) IsNull

func (p IntList) IsNull() bool

func (*IntList) Scan

func (p *IntList) Scan(data interface{}) error

Scan 实现方法

func (IntList) Value

func (p IntList) Value() (driver.Value, error)

gorm 自定义结构需要实现 Value Scan 两个方法 Value 实现方法

type NullEr

type NullEr interface {
	IsNull() bool
}

type StringList

type StringList []string

func (StringList) IsNull

func (p StringList) IsNull() bool

func (StringList) Len

func (p StringList) Len() int

func (StringList) Less

func (p StringList) Less(i, j int) bool

实现Less方法

func (*StringList) Scan

func (p *StringList) Scan(data interface{}) error

Scan 实现方法

func (StringList) Swap

func (p StringList) Swap(i, j int)

实现Swap方法

func (StringList) Value

func (p StringList) Value() (driver.Value, error)

gorm 自定义结构需要实现 Value Scan 两个方法 Value 实现方法

type Time

type Time struct {
	time.Time
}

func NowTime

func NowTime() Time

func NowTimeP added in v0.1.4

func NowTimeP() *Time

func (Time) AddData

func (t Time) AddData(d Date) DateTime

func (Time) MarshalJSON

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

func (*Time) Scan

func (t *Time) Scan(v interface{}) error

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

func (Time) Value

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

type TimeList

type TimeList []Time

func (*TimeList) Scan

func (p *TimeList) Scan(data interface{}) error

Scan 实现方法

func (TimeList) Value

func (p TimeList) Value() (driver.Value, error)

gorm 自定义结构需要实现 Value Scan 两个方法 Value 实现方法

type UUID

type UUID uuid.UUID

func NewV4

func NewV4() UUID

func NewV4P added in v0.1.4

func NewV4P() *UUID

func Str2UUID

func Str2UUID(v string) (UUID, error)

func Str2UUIDMust

func Str2UUIDMust(v string) UUID

func Str2UUIDMustP added in v0.1.4

func Str2UUIDMustP(v string) *UUID

func (UUID) MarshalJSON

func (u UUID) MarshalJSON() ([]byte, error)

func (*UUID) Scan

func (u *UUID) Scan(v interface{}) error

Scan valueof time.Time

func (UUID) String

func (u UUID) String() string

func (*UUID) UnmarshalJSON

func (u *UUID) UnmarshalJSON(src []byte) error

func (UUID) Value

func (u UUID) Value() (driver.Value, error)

type UUIDList

type UUIDList []UUID

func (*UUIDList) Scan

func (p *UUIDList) Scan(data interface{}) error

Scan 实现方法

func (UUIDList) Value

func (p UUIDList) Value() (driver.Value, error)

Value 实现方法

Jump to

Keyboard shortcuts

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