ptypes

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0, MIT Imports: 9 Imported by: 9

Documentation

Overview

Package ptypes contains types that are commonplace in test plan parameters.

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 a time.Duration and provides JSON marshal logic.

func (Duration) MarshalJSON

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

func (*Duration) UnmarshalJSON

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

type IPNet added in v0.2.6

type IPNet struct {
	net.IPNet
}

func (IPNet) MarshalJSON added in v0.2.6

func (i IPNet) MarshalJSON() ([]byte, error)

func (*IPNet) UnmarshalJSON added in v0.2.6

func (i *IPNet) UnmarshalJSON(data []byte) error

type Rate

type Rate struct {
	Quantity float64
	Interval time.Duration
}

Rate is a param that's parsed as "quantity/interval", where `quantity` is a float and `interval` is a string parsable by time.ParseDuration, e.g. "1s".

You can omit the numeric component of the interval to default to 1, e.g. "100/s" is the same as "100/1s".

Examples of valid Rate strings include: "100/s", "0.5/m", "500/5m".

func (Rate) MarshalJSON

func (r Rate) MarshalJSON() ([]byte, error)

func (*Rate) UnmarshalJSON

func (r *Rate) UnmarshalJSON(b []byte) error

type Size

type Size uint64

Size is a type that unmarshals human-readable binary sizes like "100 KB" into an uint64, where the unit is bytes.

func (Size) MarshalJSON

func (s Size) MarshalJSON() ([]byte, error)

func (*Size) UnmarshalJSON

func (s *Size) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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