utilgo.mau.fi/util/jsontime Index | Files

package jsontime

import "go.mau.fi/util/jsontime"

Index

Variables

var ErrNotInteger = errors.New("value is not an integer")

Types

type Microseconds

type Microseconds struct {
	time.Duration
}

func (*Microseconds) Get

func (s *Microseconds) Get() time.Duration

func (Microseconds) MarshalJSON

func (s Microseconds) MarshalJSON() ([]byte, error)

func (*Microseconds) Scan

func (s *Microseconds) Scan(src interface{}) error

func (*Microseconds) UnmarshalJSON

func (s *Microseconds) UnmarshalJSON(data []byte) error

func (Microseconds) Value

func (s Microseconds) Value() (driver.Value, error)

type Milliseconds

type Milliseconds struct {
	time.Duration
}

func MS

func MS(dur time.Duration) Milliseconds

func MSInt

func MSInt(dur int64) Milliseconds

func (*Milliseconds) Get

func (s *Milliseconds) Get() time.Duration

func (Milliseconds) MarshalJSON

func (s Milliseconds) MarshalJSON() ([]byte, error)

func (*Milliseconds) Scan

func (s *Milliseconds) Scan(src interface{}) error

func (*Milliseconds) UnmarshalJSON

func (s *Milliseconds) UnmarshalJSON(data []byte) error

func (Milliseconds) Value

func (s Milliseconds) Value() (driver.Value, error)

type Nanoseconds

type Nanoseconds struct {
	time.Duration
}

func (*Nanoseconds) Get

func (s *Nanoseconds) Get() time.Duration

func (Nanoseconds) MarshalJSON

func (s Nanoseconds) MarshalJSON() ([]byte, error)

func (*Nanoseconds) Scan

func (s *Nanoseconds) Scan(src interface{}) error

func (*Nanoseconds) UnmarshalJSON

func (s *Nanoseconds) UnmarshalJSON(data []byte) error

func (Nanoseconds) Value

func (s Nanoseconds) Value() (driver.Value, error)

type Seconds

type Seconds struct {
	time.Duration
}

func S

func S(dur time.Duration) Seconds

func SInt

func SInt(dur int) Seconds

func (*Seconds) Get

func (s *Seconds) Get() time.Duration

func (Seconds) MarshalJSON

func (s Seconds) MarshalJSON() ([]byte, error)

func (*Seconds) Scan

func (s *Seconds) Scan(src interface{}) error

func (*Seconds) UnmarshalJSON

func (s *Seconds) UnmarshalJSON(data []byte) error

func (Seconds) Value

func (s Seconds) Value() (driver.Value, error)

type Unix

type Unix struct {
	time.Time
}

func U

func U(time time.Time) Unix

func UInt

func UInt(ts int64) Unix

func UnixNow

func UnixNow() Unix

func (Unix) MarshalJSON

func (u Unix) MarshalJSON() ([]byte, error)

func (*Unix) Scan

func (u *Unix) Scan(src any) error

func (*Unix) UnmarshalJSON

func (u *Unix) UnmarshalJSON(data []byte) error

func (Unix) Value

func (u Unix) Value() (driver.Value, error)

type UnixMicro

type UnixMicro struct {
	time.Time
}

func UMicro

func UMicro(time time.Time) UnixMicro

func UMicroInto

func UMicroInto(ts int64) UnixMicro

func UnixMicroNow

func UnixMicroNow() UnixMicro

func (UnixMicro) MarshalJSON

func (um UnixMicro) MarshalJSON() ([]byte, error)

func (*UnixMicro) Scan

func (um *UnixMicro) Scan(src any) error

func (*UnixMicro) UnmarshalJSON

func (um *UnixMicro) UnmarshalJSON(data []byte) error

func (UnixMicro) Value

func (um UnixMicro) Value() (driver.Value, error)

type UnixMicroString

type UnixMicroString struct {
	time.Time
}

func (UnixMicroString) MarshalJSON

func (um UnixMicroString) MarshalJSON() ([]byte, error)

func (*UnixMicroString) UnmarshalJSON

func (um *UnixMicroString) UnmarshalJSON(data []byte) error

type UnixMilli

type UnixMilli struct {
	time.Time
}

func UM

func UM(time time.Time) UnixMilli

func UMInt

func UMInt(ts int64) UnixMilli

func UnixMilliNow

func UnixMilliNow() UnixMilli

func (UnixMilli) MarshalJSON

func (um UnixMilli) MarshalJSON() ([]byte, error)

func (*UnixMilli) Scan

func (um *UnixMilli) Scan(src any) error

func (*UnixMilli) UnmarshalJSON

func (um *UnixMilli) UnmarshalJSON(data []byte) error

func (UnixMilli) Value

func (um UnixMilli) Value() (driver.Value, error)

type UnixMilliString

type UnixMilliString struct {
	time.Time
}

func (UnixMilliString) MarshalJSON

func (um UnixMilliString) MarshalJSON() ([]byte, error)

func (*UnixMilliString) UnmarshalJSON

func (um *UnixMilliString) UnmarshalJSON(data []byte) error

type UnixNano

type UnixNano struct {
	time.Time
}

func UN

func UN(time time.Time) UnixNano

func UNInt

func UNInt(ts int64) UnixNano

func UnixNanoNow

func UnixNanoNow() UnixNano

func (UnixNano) MarshalJSON

func (un UnixNano) MarshalJSON() ([]byte, error)

func (*UnixNano) Scan

func (un *UnixNano) Scan(src any) error

func (*UnixNano) UnmarshalJSON

func (un *UnixNano) UnmarshalJSON(data []byte) error

func (UnixNano) Value

func (un UnixNano) Value() (driver.Value, error)

type UnixNanoString

type UnixNanoString struct {
	time.Time
}

func (UnixNanoString) MarshalJSON

func (um UnixNanoString) MarshalJSON() ([]byte, error)

func (*UnixNanoString) UnmarshalJSON

func (um *UnixNanoString) UnmarshalJSON(data []byte) error

type UnixString

type UnixString struct {
	time.Time
}

func (UnixString) MarshalJSON

func (u UnixString) MarshalJSON() ([]byte, error)

func (*UnixString) UnmarshalJSON

func (u *UnixString) UnmarshalJSON(data []byte) error

Source Files

duration.go helpers.go integer.go string.go

Version
v0.8.6 (latest)
Published
Mar 16, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
6 days ago

Tools for package owners.