types020

package
v0.6.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ImplementedSpecVersion string = "0.2.0"

Variables

View Source
var SupportedVersions = []string{"", "0.1.0", ImplementedSpecVersion}

Functions

func NewResult

func NewResult(data []byte) (types.Result, error)

Types

type IPConfig

type IPConfig struct {
	IP      net.IPNet
	Gateway net.IP
	Routes  []types.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 Result

type Result struct {
	CNIVersion string    `json:"cniVersion,omitempty"`
	IP4        *IPConfig `json:"ip4,omitempty"`
	IP6        *IPConfig `json:"ip6,omitempty"`
	DNS        types.DNS `json:"dns,omitempty"`
}

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

func GetResult

func GetResult(r types.Result) (*Result, error)

func (*Result) GetAsVersion

func (r *Result) GetAsVersion(version string) (types.Result, error)

func (*Result) Print

func (r *Result) Print() error

func (*Result) String

func (r *Result) String() string

String returns a formatted string in the form of "[IP4: $1,][ IP6: $2,] DNS: $3" where $1 represents the receiver's IPv4, $2 represents the receiver's IPv6 and $3 the receiver's DNS. If $1 or $2 are nil, they won't be present in the returned string.

func (*Result) Version

func (r *Result) Version() string

Jump to

Keyboard shortcuts

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