types100

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 25

Documentation

Index

Constants

View Source
const ImplementedSpecVersion string = "1.0.0"

Variables

This section is empty.

Functions

func Int

func Int(v int) *int

Int returns a pointer to the int value passed in. Used to set the IPConfig.Interface field.

func NewResult

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

Types

type IPConfig

type IPConfig struct {
	// Index into Result structs Interfaces list
	Interface *int
	Address   net.IPNet
	Gateway   net.IP
}

IPConfig contains values necessary to configure an IP address on an interface

func (*IPConfig) Copy

func (i *IPConfig) Copy() *IPConfig

func (*IPConfig) MarshalJSON

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

func (*IPConfig) String

func (i *IPConfig) String() string

func (*IPConfig) UnmarshalJSON

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

type Interface

type Interface struct {
	Name    string `json:"name"`
	Mac     string `json:"mac,omitempty"`
	Sandbox string `json:"sandbox,omitempty"`
}

Interface contains values about the created interfaces

func (*Interface) Copy

func (i *Interface) Copy() *Interface

func (*Interface) String

func (i *Interface) String() string

type Result

type Result struct {
	CNIVersion string         `json:"cniVersion,omitempty"`
	Interfaces []*Interface   `json:"interfaces,omitempty"`
	IPs        []*IPConfig    `json:"ips,omitempty"`
	Routes     []*types.Route `json:"routes,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 NewResultFromResult

func NewResultFromResult(result 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) PrintTo

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