util

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlagError added in v0.3.0

func FlagError(name string, value interface{}, reason string) error

Error return new InvalidFlagError.

func IsFilePath added in v0.3.0

func IsFilePath(name string) bool

func StringKeys added in v0.3.0

func StringKeys(v map[string]string) []string

StringKeys returns sorted keys.

func Timeout added in v0.3.0

func Timeout(t time.Duration, fn func() error) error

Timeout stops the slow function at the specified time

func UniqueStringSlice added in v0.3.0

func UniqueStringSlice(data []string) []string

UniqueStringSlice returns unique slice.

Types

type InvalidFlagError added in v0.3.0

type InvalidFlagError struct {
	// contains filtered or unexported fields
}

InvalidArgumentError is an invalid flag parameter error.

func (*InvalidFlagError) Error added in v0.3.0

func (e *InvalidFlagError) Error() string

Error returns error message.

type TimeoutError added in v0.3.0

type TimeoutError struct {
	// contains filtered or unexported fields
}

TimeoutError returns in util.Timeout when a timeout occurs.

func (*TimeoutError) Error added in v0.3.0

func (err *TimeoutError) Error() string

Error returns error message.

Jump to

Keyboard shortcuts

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