utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes2String

func Bytes2String(b []byte) string

func WaitForExit

func WaitForExit(twice bool, closeCh ...chan int)

Types

type Duration

type Duration time.Duration

Duration wraps time.Duration. It is used to parse the custom duration format from YAML. This type should not propagate beyond the scope of input/output processing.

func ParseDuration

func ParseDuration(durationStr string) (Duration, error)

ParseDuration parses a string into a time.Duration, assuming that a year always has 365d, a week always has 7d, and a day always has 24h.

func (Duration) MarshalYAML

func (d Duration) MarshalYAML() (interface{}, error)

MarshalYAML implements the yaml.Marshaler interface.

func (*Duration) Set

func (d *Duration) Set(s string) error

Set implements pflag/flag.Value

func (Duration) String

func (d Duration) String() string

func (*Duration) Type

func (d *Duration) Type() string

Type implements pflag.Value

func (*Duration) UnmarshalYAML

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

UnmarshalYAML implements the yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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