types020

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 145

Documentation

Index

Constants

View Source
const ImplementedSpecVersion string = "0.2.0"

Variables

This section is empty.

Functions

func NewResult

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

NewResult creates a new Result object from JSON data. The JSON data must be compatible with the CNI versions implemented by this type.

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) Copy added in v1.0.0

func (i *IPConfig) Copy() *IPConfig

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)

GetResult converts the given Result object to the ImplementedSpecVersion and returns the concrete type or an error

func (*Result) GetAsVersion

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

func (*Result) Print

func (r *Result) Print() error

func (*Result) PrintTo added in v0.7.0

func (r *Result) PrintTo(writer io.Writer) error

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