package types100
import "github.com/containernetworking/cni/pkg/types/100"
Index ¶
- Constants
- func Int(v int) *int
- func NewResult(data []byte) (types.Result, error)
- type IPConfig
- func (i *IPConfig) Copy() *IPConfig
- func (c *IPConfig) MarshalJSON() ([]byte, error)
- func (i *IPConfig) String() string
- func (c *IPConfig) UnmarshalJSON(data []byte) error
- type Interface
- type Result
- func GetResult(r types.Result) (*Result, error)
- func NewResultFromResult(result types.Result) (*Result, error)
- func (r *Result) GetAsVersion(version string) (types.Result, error)
- func (r *Result) MarshalJSON() ([]byte, error)
- func (r *Result) Print() error
- func (r *Result) PrintTo(writer io.Writer) error
- func (r *Result) Version() string
Constants ¶
const ImplementedSpecVersion string = "1.1.0"
The types did not change between v1.0 and v1.1
Functions ¶
func Int ¶
Int returns a pointer to the int value passed in. Used to set the IPConfig.Interface field.
func NewResult ¶
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 (*IPConfig) MarshalJSON ¶
func (*IPConfig) String ¶
func (*IPConfig) UnmarshalJSON ¶
type Interface ¶
type Interface struct {
Name string `json:"name"`
Mac string `json:"mac,omitempty"`
Mtu int `json:"mtu,omitempty"`
Sandbox string `json:"sandbox,omitempty"`
SocketPath string `json:"socketPath,omitempty"`
PciID string `json:"pciID,omitempty"`
}
Interface contains values about the created interfaces
func (*Interface) Copy ¶
func (*Interface) 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 NewResultFromResult ¶
func (*Result) GetAsVersion ¶
func (*Result) MarshalJSON ¶
Note: DNS should be omit if DNS is empty but default Marshal function will output empty structure hence need to write a Marshal function
func (*Result) Print ¶
func (*Result) PrintTo ¶
func (*Result) Version ¶
Source Files ¶
- Version
- v1.3.0 (latest)
- Published
- Apr 7, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 4 months ago –
Tools for package owners.