types

package
v1.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Package types contains useful custom types that are common across the WebPA application. In particular, better JSON support for some of the more advance golang types is provided.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration time.Duration

Duration is an extension of time.Duration that provides prettier JSON support

func (Duration) MarshalJSON

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

MarshalJSON produces a formatted string of the form produced by time.Duration.String()

func (Duration) String

func (d Duration) String() string

String delegates to time.Duration.String()

func (*Duration) UnmarshalJSON

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

UnmarshalJSON permits either: (1) strings of the form accepted by time.ParseDuration(), or (2) numeric time values, which are assumed to be nanoseconds.

Jump to

Keyboard shortcuts

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