common

package
v9.9.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Log *logrus.Logger
)

Functions

func AllPids

func AllPids(procRoot string) ([]int, error)

func Assert

func Assert(test bool)

Assert test is true, panic otherwise

func CheckFatal

func CheckFatal(e error)

func CheckWarn

func CheckWarn(e error)

func ConnectedToBridgePredicate

func ConnectedToBridgePredicate(bridgeName string) (func(link netlink.Link) bool, error)

ConnectedToBridgePredicate returns a function which is used to query whether a given link is a veth interface which one end is connected to a bridge. The returned function should be called from a container network namespace which the bridge does NOT belong to.

func ErrorMessages

func ErrorMessages(errors []error) string

func LogLogger

func LogLogger() *log.Logger

func LoggingHTTPHandler

func LoggingHTTPHandler(h http.Handler) http.Handler

func SetLogLevel

func SetLogLevel(levelname string)

func SignalHandlerLoop

func SignalHandlerLoop(ss ...SignalReceiver)

Types

type NetDev

type NetDev struct {
	Name  string
	MAC   net.HardwareAddr
	CIDRs []*net.IPNet
}

func FindNetDevs

func FindNetDevs(processID int, match func(link netlink.Link) bool) ([]NetDev, error)

Search the network namespace of a process for interfaces matching a predicate Note that the predicate is called while the goroutine is inside the process' netns

func GetBridgeNetDev

func GetBridgeNetDev(bridgeName string) (NetDev, error)

Get the weave bridge interface. NB: Should be called from the root network namespace.

func GetNetDevsWithPredicate

func GetNetDevsWithPredicate(processID int, predicate func(link netlink.Link) bool) ([]NetDev, error)

func GetWeaveNetDevs

func GetWeaveNetDevs(processID int) ([]NetDev, error)

Lookup the weave interface of a container

type SignalReceiver

type SignalReceiver interface {
	Stop() error
}

A subsystem/server/... that can be stopped or queried about the status with a signal

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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