epoch

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatTime

func FormatTime(t time.Time, to timeseries.FieldDataType, quoteDateTimeSQL bool) string

Types

type Epoch

type Epoch int64

Epoch represents an Epoch timestamp in Nanoseconds and has possible values between 1970/1/1 and 2262/4/12

const (
	BillionNS Epoch = 1000000000
	MillionNS Epoch = 1000000
)

func FromMilliSecs

func FromMilliSecs(input int64) Epoch

func FromNanoSecs

func FromNanoSecs(input int64) Epoch

func FromSecs

func FromSecs(input int64) Epoch

func (*Epoch) DecodeMsg

func (z *Epoch) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Epoch) EncodeMsg

func (z Epoch) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Epoch) Format

func (e Epoch) Format(to timeseries.FieldDataType, quoteDateTimeSQL bool) string

Format returns the epoch as a string in the specified format

func (Epoch) MarshalMsg

func (z Epoch) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Epoch) Msgsize

func (z Epoch) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Epoch) UnmarshalMsg

func (z *Epoch) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Epochs

type Epochs []Epoch

Epochs is a slice of type Epoch

func (*Epochs) DecodeMsg

func (z *Epochs) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Epochs) EncodeMsg

func (z Epochs) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Epochs) MarshalMsg

func (z Epochs) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Epochs) Msgsize

func (z Epochs) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Epochs) UnmarshalMsg

func (z *Epochs) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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