types

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NullDecoder added in v0.22.0

func NullDecoder(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error)

Types

type Duration

type Duration time.Duration

Duration is an alias for time.Duration that de/serialises to JSON as human-readable strings.

func (Duration) MarshalJSON

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

func (Duration) String

func (d Duration) String() string

func (*Duration) UnmarshalJSON

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

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(data []byte) error

type NullDuration

type NullDuration struct {
	Duration
	Valid bool
}

NullDuration is a nullable Duration, in the same vein as the nullable types provided by package gopkg.in/guregu/null.v3.

func NewNullDuration added in v0.21.0

func NewNullDuration(d time.Duration, valid bool) NullDuration

NewNullDuration is a simple helper constructor function

func NullDurationFrom

func NullDurationFrom(d time.Duration) NullDuration

Creates a valid NullDuration from a time.Duration.

func (NullDuration) MarshalJSON

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

func (*NullDuration) UnmarshalJSON

func (d *NullDuration) UnmarshalJSON(data []byte) error

func (*NullDuration) UnmarshalText

func (d *NullDuration) UnmarshalText(data []byte) error

Jump to

Keyboard shortcuts

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