marshaler

package
v1.0.0-beta.26 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration int64

Duration implements a JSON Marshaler to encode a time.Duration in milliseconds.

func NewDuration

func NewDuration(t *time.Duration) *Duration

NewDuration converts a *time.Duration to a *Duration type.

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON encodes the Duration in milliseconds.

func (*Duration) Standard

func (d *Duration) Standard() *time.Duration

Standard converts a *Duration to a *time.Duration type.

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON decodes milliseconds to Duration.

type DurationSlice

type DurationSlice []*Duration

DurationSlice is a slice of *Duration

func NewDurationSlice

func NewDurationSlice(t []*time.Duration) DurationSlice

NewDurationSlice converts a []*time.Duration to a DurationSlice type.

func (*DurationSlice) Standard

func (ds *DurationSlice) Standard() []*time.Duration

Standard converts a DurationSlice to a []*time.Duration type.

type Durationint32Map

type Durationint32Map map[int32]*Duration

Durationint32Map is a int32 map of *Duration

func NewDurationint32Map

func NewDurationint32Map(t map[int32]*time.Duration) Durationint32Map

NewDurationint32Map converts a map[int32]*time.Duration to a Durationint32Map type.

func (*Durationint32Map) Standard

func (dm *Durationint32Map) Standard() map[int32]*time.Duration

Standard converts a Durationint32Map to a map[int32]*time.Duration type.

type LongDuration

type LongDuration int64

LongDuration implements a JSON Marshaler to encode a time.Duration in days.

func NewLongDuration

func NewLongDuration(t *time.Duration) *LongDuration

NewLongDuration converts a *time.Duration to a *LongDuration type.

func (LongDuration) MarshalJSON

func (d LongDuration) MarshalJSON() ([]byte, error)

MarshalJSON encodes the LongDuration in days.

func (*LongDuration) Standard

func (d *LongDuration) Standard() *time.Duration

Standard converts a *LongDuration to a *time.Duration type.

func (*LongDuration) UnmarshalJSON

func (d *LongDuration) UnmarshalJSON(b []byte) error

UnmarshalJSON decodes days to LongDuration.

type LongDurationSlice

type LongDurationSlice []*LongDuration

LongDurationSlice is a slice of *LongDuration

func NewLongDurationSlice

func NewLongDurationSlice(t []*time.Duration) LongDurationSlice

NewLongDurationSlice converts a []*time.Duration to a LongDurationSlice type.

func (*LongDurationSlice) Standard

func (ds *LongDurationSlice) Standard() []*time.Duration

Standard converts a LongDurationSlice to a []*time.Duration type.

type LongDurationint32Map

type LongDurationint32Map map[int32]*LongDuration

LongDurationint32Map is a int32 map of *LongDuration

func NewLongDurationint32Map

func NewLongDurationint32Map(t map[int32]*time.Duration) LongDurationint32Map

NewLongDurationint32Map converts a map[int32]*time.LongDuration to a LongDurationint32Map type.

func (*LongDurationint32Map) Standard

func (dm *LongDurationint32Map) Standard() map[int32]*time.Duration

Standard converts a LongDurationint32Map to a map[int32]*time.LongDuration type.

Jump to

Keyboard shortcuts

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