types

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 License: MIT Imports: 3 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 `json:"-"`
}

Duration is a wrapper around time.Duration that implements json.Marshaler and json.Unmarshaler. It parses strings with time.ParseDuration(value) and numbers with time.Duration(value)

func (Duration) MarshalJSON

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

func (*Duration) UnmarshalJSON

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

func (Duration) UnmarshalKind

func (d Duration) UnmarshalKind() string

type Time

type Time struct {
	time.Time `json:"-"`
}

Time is a wrapper around time.Time that implements json.Marshaler and json.Unmarshaler. It parses string values in RFC3339 format (with RFC3339Nano as fallback)

func (Time) MarshalJSON

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

func (*Time) UnmarshalJSON

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

func (Time) UnmarshalKind

func (t Time) UnmarshalKind() string

Jump to

Keyboard shortcuts

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