datatypes

package
v2.21.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: MIT Imports: 7 Imported by: 1

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

type Datetime time.Time

openapi:strfmt date-time

func ParseDatetimeFromString

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

func ParseDatetimeFromStringWithFormatterInCST

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

func (Datetime) DataType

func (Datetime) DataType(e string) string

func (Datetime) Format

func (dt Datetime) Format(layout string) string

func (Datetime) In

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

func (Datetime) IsZero

func (dt Datetime) IsZero() bool

func (Datetime) MarshalText

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

func (*Datetime) Scan

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

func (Datetime) String

func (dt Datetime) String() string

func (Datetime) Unix

func (dt Datetime) Unix() int64

func (*Datetime) UnmarshalText

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

func (Datetime) Value

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

type MySQLDatetime

type MySQLDatetime = Datetime

type MySQLTimestamp

type MySQLTimestamp = Timestamp

type Timestamp

type Timestamp time.Time

openapi:strfmt date-time

func ParseTimestampFromString

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

func ParseTimestampFromStringWithLayout

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

func (*Timestamp) DataType

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

func (Timestamp) Format

func (dt Timestamp) Format(layout string) string

func (Timestamp) In

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

func (Timestamp) IsZero

func (dt Timestamp) IsZero() bool

func (Timestamp) MarshalText

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

func (*Timestamp) Scan

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

func (Timestamp) String

func (dt Timestamp) String() string

func (Timestamp) Unix

func (dt Timestamp) Unix() int64

func (*Timestamp) UnmarshalText

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

func (Timestamp) Value

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