customtypes

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePostgreSQLInterval

func ParsePostgreSQLInterval(s string) (result time.Duration, err error)

parses a string in postgresql format as an interval (duration). Example PG format: `select '1 year 2 months 3 days 4 hours 5 minutes 6 seconds 7 milliseconds 8 microseconds'::interval` `1 year 2 mons 3 days 04:05:06.007008` PG only supports ns-level resolution

Types

type Interval

type Interval time.Duration

func IntervalPtr

func IntervalPtr(duration time.Duration) *Interval

func (Interval) MarshalJSON

func (i Interval) MarshalJSON() ([]byte, error)

func (*Interval) Scan

func (i *Interval) Scan(src interface{}) error

func (Interval) String

func (i Interval) String() string

func (*Interval) UnmarshalJSON

func (i *Interval) UnmarshalJSON(data []byte) error

func (Interval) Value

func (i Interval) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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