common

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2016 License: Apache-2.0 Imports: 10 Imported by: 150

Documentation

Index

Constants

View Source
const (
	StoppedState = iota
	RunningState
	StoppingState
)

Variables

View Source
var (
	CantCompareInterface error = errors.New("Can't compare interface")
	CaptureTypes               = map[string]CaptureType{}
)

Functions

func CrossTypeCompare added in v0.5.0

func CrossTypeCompare(a interface{}, b interface{}) (int, error)

func CrossTypeEqual

func CrossTypeEqual(a interface{}, b interface{}) bool

func IPToString added in v0.8.0

func IPToString(ip net.IP) string

func IPv6Supported added in v0.8.0

func IPv6Supported() bool

func IsCaptureAllowed added in v0.5.0

func IsCaptureAllowed(nodeType string) bool

func MaxInt64

func MaxInt64(a, b int64) int64

func MinInt64

func MinInt64(a, b int64) int64

func Retry

func Retry(fnc func() error, try int, delay time.Duration) error

Retry tries to execute the given function until a success applying a delay between each try

func ToFloat64 added in v0.8.0

func ToFloat64(f interface{}) (float64, error)

func ToInt64 added in v0.8.0

func ToInt64(i interface{}) (int64, error)

Types

type CaptureType added in v0.7.0

type CaptureType struct {
	Allowed []string
	Default string
}

type Iterator added in v0.6.0

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

func NewIterator added in v0.6.0

func NewIterator(values ...int64) (it *Iterator)

func (*Iterator) Done added in v0.6.0

func (it *Iterator) Done() bool

func (*Iterator) Next added in v0.6.0

func (it *Iterator) Next() bool

type NetNSContext added in v0.8.0

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

func NewNetNsContext added in v0.8.0

func NewNetNsContext(path string) (*NetNSContext, error)

func (*NetNSContext) Close added in v0.8.0

func (n *NetNSContext) Close()

func (*NetNSContext) Quit added in v0.8.0

func (n *NetNSContext) Quit() error

Jump to

Keyboard shortcuts

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