datum

package
v0.0.0-...-959c02d Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Null = dNull(0)

Variables

This section is empty.

Functions

func AsBool

func AsBool(d Datum) bool

func AsBytes

func AsBytes(d Datum) []byte

func AsDecimal

func AsDecimal(d Datum) *apd.Decimal

func AsFloat

func AsFloat(d Datum) float64

func AsInt

func AsInt(d Datum) int64

func AsString

func AsString(d Datum) string

func ParseTimeOrTimeTZ

func ParseTimeOrTimeTZ(s string) (*Time, *TimeTZ, error)

func ParseTimestampOrTimestampTZ

func ParseTimestampOrTimestampTZ(s string) (*Timestamp, *TimestampTZ, error)

func TryAsBool

func TryAsBool(d Datum) (bool, error)

func TryAsBytes

func TryAsBytes(d Datum) ([]byte, error)

func TryAsDecimal

func TryAsDecimal(d Datum) (*apd.Decimal, error)

func TryAsFloat

func TryAsFloat(d Datum) (float64, error)

func TryAsInt

func TryAsInt(d Datum) (int64, error)

func TryAsString

func TryAsString(d Datum) (string, error)

Types

type Date

type Date struct {
	// contains filtered or unexported fields
}

func AsDate

func AsDate(d Datum) *Date

func NewDateFromUnixEpochDays

func NewDateFromUnixEpochDays(days int32) *Date

func ParseDate

func ParseDate(s string) (*Date, error)

func TryAsDate

func TryAsDate(d Datum) (*Date, error)

func (*Date) String

func (d *Date) String() string

func (*Date) Type

func (*Date) Type() types.T

func (*Date) UnixEpochDays

func (d *Date) UnixEpochDays() int32

type Datum

type Datum interface {
	Type() types.T
	String() string
	// contains filtered or unexported methods
}

func NewBool

func NewBool(b bool) Datum

func NewBytes

func NewBytes(b []byte) Datum

func NewDecimal

func NewDecimal(d *apd.Decimal) Datum

func NewFloat

func NewFloat(f float64) Datum

func NewInt

func NewInt(i int64) Datum

func NewString

func NewString(s string) Datum

func ParseDecimal

func ParseDecimal(s string) (Datum, error)

type Edge

type Edge struct {
	SrcID  int64
	DstID  int64
	Labels []string
	Props  map[string]Datum
}

func AsEdge

func AsEdge(d Datum) *Edge

func TryAsEdge

func TryAsEdge(d Datum) (*Edge, error)

func (*Edge) String

func (e *Edge) String() string

func (*Edge) Type

func (e *Edge) Type() types.T

type Interval

type Interval struct {
	// contains filtered or unexported fields
}

func AsInterval

func AsInterval(d Datum) *Interval

func NewInterval

func NewInterval(dur int64, unit IntervalUnit) *Interval

func TryAsInterval

func TryAsInterval(d Datum) (*Interval, error)

func (*Interval) String

func (i *Interval) String() string

func (*Interval) Type

func (i *Interval) Type() types.T

type IntervalUnit

type IntervalUnit uint8
const (
	IntervalUnitYear IntervalUnit = iota
	IntervalUnitMonth
	IntervalUnitDay
	IntervalUnitHour
	IntervalUnitMinute
	IntervalUnitSecond
)

type Row

type Row []Datum

type Time

type Time struct {
	TimeOfDay
}

func AsTime

func AsTime(d Datum) *Time

func NewTime

func NewTime(t TimeOfDay) *Time

func ParseTime

func ParseTime(s string) (*Time, error)

func TryAsTime

func TryAsTime(d Datum) (*Time, error)

func (*Time) String

func (t *Time) String() string

func (*Time) Type

func (*Time) Type() types.T

type TimeOfDay

type TimeOfDay int32 // seconds since midnight

func (*TimeOfDay) Hour

func (t *TimeOfDay) Hour() int

func (*TimeOfDay) Minute

func (t *TimeOfDay) Minute() int

func (*TimeOfDay) Second

func (t *TimeOfDay) Second() int

type TimeTZ

type TimeTZ struct {
	TimeOfDay
	// contains filtered or unexported fields
}

func AsTimeTZ

func AsTimeTZ(d Datum) *TimeTZ

func ParseTimeTZ

func ParseTimeTZ(s string) (*TimeTZ, error)

func TryAsTimeTZ

func TryAsTimeTZ(d Datum) (*TimeTZ, error)

func (*TimeTZ) String

func (t *TimeTZ) String() string

func (*TimeTZ) Type

func (t *TimeTZ) Type() types.T

type Timestamp

type Timestamp struct {
	time.Time
}

func AsTimestamp

func AsTimestamp(d Datum) *Timestamp

func ParseTimestamp

func ParseTimestamp(s string) (*Timestamp, error)

func TryAsTimestamp

func TryAsTimestamp(d Datum) (*Timestamp, error)

func (*Timestamp) String

func (t *Timestamp) String() string

func (*Timestamp) Type

func (t *Timestamp) Type() types.T

type TimestampTZ

type TimestampTZ struct {
	time.Time
}

func AsTimestampTZ

func AsTimestampTZ(d Datum) *TimestampTZ

func ParseTimestampTZ

func ParseTimestampTZ(s string) (*TimestampTZ, error)

func TryAsTimestampTZ

func TryAsTimestampTZ(d Datum) (*TimestampTZ, error)

func (*TimestampTZ) String

func (t *TimestampTZ) String() string

func (*TimestampTZ) Type

func (t *TimestampTZ) Type() types.T

type Vertex

type Vertex struct {
	ID     int64
	Labels []string
	Props  map[string]Datum
}

func AsVertex

func AsVertex(d Datum) *Vertex

func TryAsVertex

func TryAsVertex(d Datum) (*Vertex, error)

func (*Vertex) String

func (v *Vertex) String() string

func (*Vertex) Type

func (v *Vertex) Type() types.T

Jump to

Keyboard shortcuts

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