marshal

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 6 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 struct {
	time.Duration
}

Duration wraps time.Duration for JSON marshaling

func (Duration) MarshalJSON

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

MarshalJSON implements Marshaler interface

func (*Duration) UnmarshalJSON

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

UnmarshalJSON implements Unmarshaler interface

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) (err error)

UnmarshalYAML implements Unmarshaler interface

type NanoTime

type NanoTime struct {
	time.Time
}

NanoTime wraps time for marshaling time at the nanosecond level

func (NanoTime) MarshalJSON

func (t NanoTime) MarshalJSON() ([]byte, error)

func (*NanoTime) UnmarshalJSON

func (t *NanoTime) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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