utils

package
v0.0.0-10-16-2015.09-0... Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EtcdNameStr is a string constant for etcd state-store
	EtcdNameStr = "etcd"
	// ConsulNameStr is a string constant for consul state-store
	ConsulNameStr = "consul"
	// OvsNameStr is a string constant for ovs driver
	OvsNameStr = "ovs"
)

Variables

This section is empty.

Functions

func FetchSysAttrs

func FetchSysAttrs() error

FetchSysAttrs would read the system attributes and store them in the exported vars for the plugin to use; some of the attributes may need OS spefici methods to fetch, thus the first attribute to fetch is the OS type

func GetStateDriver

func GetStateDriver() (core.StateDriver, error)

GetStateDriver returns the singleton instance of the state-driver

func NewNetworkDriver

func NewNetworkDriver(name, configStr string, instInfo *core.InstanceInfo) (core.NetworkDriver, error)

NewNetworkDriver instantiates a 'named' network-driver with specified configuration

func NewStateDriver

func NewStateDriver(name, configStr string) (core.StateDriver, error)

NewStateDriver instantiates a 'named' state-driver with specified configuration

func ReleaseStateDriver

func ReleaseStateDriver()

ReleaseStateDriver releases the singleton instance of the state-driver

Types

type LLDPNeighbor

type LLDPNeighbor struct {
	SystemName        string
	SystemDescription string
	PortID            string
	PortDesc          string
	CiscoACIPodID     string
	CiscoACINodeID    string
}

LLDPNeighbor lists the neighbor attributes as learned by the host

func FetchLLDPInfo

func FetchLLDPInfo(crt *crt.CRT, ifname string) (*LLDPNeighbor, error)

FetchLLDPInfo reads the lldp information using lldptool A native go lib could be done but it requires that lldpad daemon is accessible natively on the lldp ipc path

type SystemAttributes

type SystemAttributes struct {
	OsType      string
	TotalRAM    int
	TotalDiskGB int
	TotalNetBw  int
}

SystemAttributes enlist the system specific attributes and are read upon the system start

var SysAttrs SystemAttributes

Exported system attributes

Jump to

Keyboard shortcuts

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