datatypes

package
v2.14.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UTC               = time.UTC
	CST               = time.FixedZone("CST", 8*60*60)
	TimestampZero     = Timestamp(time.Time{})
	TimestampUnixZero = Timestamp(time.Unix(0, 0))
)
View Source
var (
	DatetimeZero = Datetime(time.Time{})
)

Functions

func JSONScan

func JSONScan(dbValue interface{}, value interface{}) error

func JSONValue

func JSONValue(value interface{}) (driver.Value, error)

Types

type Bool

type Bool int

openapi:type boolean

const (
	BOOL_UNKNOWN Bool = iota
	BOOL_TRUE         // true
	BOOL_FALSE        // false
)

func (Bool) MarshalJSON

func (v Bool) MarshalJSON() ([]byte, error)

func (Bool) MarshalText

func (v Bool) MarshalText() ([]byte, error)

func (*Bool) UnmarshalJSON

func (v *Bool) UnmarshalJSON(data []byte) (err error)

func (*Bool) UnmarshalText

func (v *Bool) UnmarshalText(data []byte) (err error)

type Datetime added in v2.11.0

type Datetime time.Time

openapi:strfmt date-time

func ParseDatetimeFromString added in v2.11.0

func ParseDatetimeFromString(s string) (dt Datetime, err error)

func ParseDatetimeFromStringWithFormatterInCST added in v2.11.0

func ParseDatetimeFromStringWithFormatterInCST(s, formatter string) (dt Datetime, err error)

func (Datetime) DataType added in v2.11.0

func (Datetime) DataType(e string) string

func (Datetime) Format added in v2.11.0

func (dt Datetime) Format(layout string) string

func (Datetime) In added in v2.11.0

func (dt Datetime) In(loc *time.Location) Datetime

func (Datetime) IsZero added in v2.11.0

func (dt Datetime) IsZero() bool

func (Datetime) MarshalText added in v2.11.0

func (dt Datetime) MarshalText() ([]byte, error)

func (*Datetime) Scan added in v2.11.0

func (dt *Datetime) Scan(value interface{}) error

func (Datetime) String added in v2.11.0

func (dt Datetime) String() string

func (Datetime) Unix added in v2.11.0

func (dt Datetime) Unix() int64

func (*Datetime) UnmarshalText added in v2.11.0

func (dt *Datetime) UnmarshalText(data []byte) (err error)

func (Datetime) Value added in v2.11.0

func (dt Datetime) Value() (driver.Value, error)

type MySQLDatetime

type MySQLDatetime = Datetime

type MySQLTimestamp

type MySQLTimestamp = Timestamp

type Timestamp added in v2.11.0

type Timestamp time.Time

openapi:strfmt date-time

func ParseTimestampFromString added in v2.11.0

func ParseTimestampFromString(s string) (dt Timestamp, err error)

func ParseTimestampFromStringWithLayout added in v2.11.0

func ParseTimestampFromStringWithLayout(input, layout string) (Timestamp, error)

func (*Timestamp) DataType added in v2.11.0

func (dt *Timestamp) DataType(engine string) string

func (Timestamp) Format added in v2.11.0

func (dt Timestamp) Format(layout string) string

func (Timestamp) In added in v2.11.0

func (dt Timestamp) In(loc *time.Location) Timestamp

func (Timestamp) IsZero added in v2.11.0

func (dt Timestamp) IsZero() bool

func (Timestamp) MarshalText added in v2.11.0

func (dt Timestamp) MarshalText() ([]byte, error)

func (*Timestamp) Scan added in v2.11.0

func (dt *Timestamp) Scan(value interface{}) error

func (Timestamp) String added in v2.11.0

func (dt Timestamp) String() string

func (Timestamp) Unix added in v2.11.0

func (dt Timestamp) Unix() int64

func (*Timestamp) UnmarshalText added in v2.11.0

func (dt *Timestamp) UnmarshalText(data []byte) (err error)

func (Timestamp) Value added in v2.11.0

func (dt Timestamp) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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