types

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadArgs

func LoadArgs(args string, container interface{}) error

func ParseCIDR

func ParseCIDR(s string) (*net.IPNet, error)

ParseCIDR takes a string like "10.2.3.1/24" and return IPNet with "10.2.3.1" and /24 mask

Types

type Error

type Error struct {
	Code    uint   `json:"code"`
	Msg     string `json:"msg"`
	Details string `json:"details,omitempty"`
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Print

func (e *Error) Print() error

type IPConfig

type IPConfig struct {
	IP      net.IPNet
	Gateway net.IP
	Routes  []Route
}

IPConfig contains values necessary to configure an interface

func (*IPConfig) MarshalJSON

func (c *IPConfig) MarshalJSON() ([]byte, error)

func (*IPConfig) UnmarshalJSON

func (c *IPConfig) UnmarshalJSON(data []byte) error

type IPNet

type IPNet net.IPNet

like net.IPNet but adds JSON marshalling and unmarshalling

func (IPNet) MarshalJSON

func (n IPNet) MarshalJSON() ([]byte, error)

func (*IPNet) UnmarshalJSON

func (n *IPNet) UnmarshalJSON(data []byte) error

type NetConf

type NetConf struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
	IPAM struct {
		Type string `json:"type,omitempty"`
	} `json:"ipam,omitempty"`
}

NetConf describes a network.

type Result

type Result struct {
	IP4 *IPConfig `json:"ip4,omitempty"`
	IP6 *IPConfig `json:"ip6,omitempty"`
}

Result is what gets returned from the plugin (via stdout) to the caller

func (*Result) Print

func (r *Result) Print() error

type Route

type Route struct {
	Dst net.IPNet
	GW  net.IP
}

func (*Route) MarshalJSON

func (r *Route) MarshalJSON() ([]byte, error)

func (*Route) UnmarshalJSON

func (r *Route) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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