datatypes

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TimestampTzZero     = PgTimestampTz(time.Time{})
	TimestampTzUnixZero = PgTimestampTz(time.Unix(0, 0))
)
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) OpenAPISchemaType

func (Bool) OpenAPISchemaType() []string

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 PgTimestampTz added in v1.0.2

type PgTimestampTz time.Time

func ParseTimestampTzFromString added in v1.0.2

func ParseTimestampTzFromString(s string) (dt PgTimestampTz, err error)

func (*PgTimestampTz) DataType added in v1.0.2

func (p *PgTimestampTz) DataType(driverName string) string

func (*PgTimestampTz) Format added in v1.0.2

func (p *PgTimestampTz) Format(layout string) string

func (*PgTimestampTz) IsZero added in v1.0.2

func (p *PgTimestampTz) IsZero() bool

func (*PgTimestampTz) MarshalText added in v1.0.2

func (p *PgTimestampTz) MarshalText() (text []byte, err error)

func (*PgTimestampTz) Scan added in v1.0.2

func (p *PgTimestampTz) Scan(value any) error

func (*PgTimestampTz) String added in v1.0.2

func (p *PgTimestampTz) String() string

func (*PgTimestampTz) Unix added in v1.0.2

func (p *PgTimestampTz) Unix() int64

func (*PgTimestampTz) UnmarshalText added in v1.0.2

func (p *PgTimestampTz) UnmarshalText(text []byte) (err error)

func (*PgTimestampTz) Value added in v1.0.2

func (p *PgTimestampTz) Value() (driver.Value, error)

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 (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