database

package
v0.4.25 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int32Pointer added in v0.0.9

func Int32Pointer(i interface{}) *int32

func Int64Pointer added in v0.0.9

func Int64Pointer(i interface{}) *int64

func IntPointer added in v0.0.9

func IntPointer(i interface{}) *int

func StrPointer added in v0.0.9

func StrPointer(str interface{}) *string

func UInt32Pointer added in v0.0.9

func UInt32Pointer(i interface{}) *uint32

func UInt64Pointer added in v0.0.9

func UInt64Pointer(i interface{}) *uint64

Types

type JSON

type JSON []byte

func NewJSON added in v0.0.4

func NewJSON(v interface{}) JSON

func (JSON) Equals

func (j JSON) Equals(j1 JSON) bool

func (JSON) IsNull

func (j JSON) IsNull() bool

func (JSON) MarshalJSON

func (j JSON) MarshalJSON() ([]byte, error)

func (*JSON) Scan

func (j *JSON) Scan(value interface{}) error

func (*JSON) Trans added in v0.4.20

func (j *JSON) Trans(v interface{}) error

func (*JSON) UnmarshalJSON

func (j *JSON) UnmarshalJSON(data []byte) error

func (JSON) Value

func (j JSON) Value() (driver.Value, error)

type Time

type Time struct {
	time.Time
}

func IntDateToTime added in v0.1.6

func IntDateToTime(date int32) Time

IntDateToTime INT的日期格式转为时间

func Now

func Now() Time

func NowPointer

func NowPointer() *Time

func StrToTime added in v0.1.4

func StrToTime(str string) Time

StrToTime 字符串转时间类型,仅支持两种格式

func UnixToTime added in v0.1.5

func UnixToTime(unix int64) Time

UnixToTime 时间戳转时间类型

func (Time) Add added in v0.2.1

func (t Time) Add(d time.Duration) Time

func (Time) AddDate added in v0.2.1

func (t Time) AddDate(years int, months int, days int) Time

func (Time) After added in v0.2.1

func (t Time) After(u time.Time) bool

func (Time) DayEnd added in v0.1.4

func (t Time) DayEnd() string

func (Time) MarshalJSON added in v0.1.4

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

func (*Time) Scan

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

Scan 读取数据库时会调用该方法将时间数据转换成自定义时间类型

func (Time) Sub added in v0.2.1

func (t Time) Sub(u Time) time.Duration

func (Time) TimeToIntDate added in v0.1.6

func (t Time) TimeToIntDate() int32

TimeToIntDate 时间转为INT的日期格式(20060102)

func (*Time) UnmarshalJSON added in v0.1.4

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

func (Time) Value

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

Value 写入数据库时会调用该方法将自定义时间类型转换并写入数据库

func (Time) Ymd added in v0.1.4

func (t Time) Ymd() string

func (Time) YmdHis

func (t Time) YmdHis() string

Jump to

Keyboard shortcuts

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