Documentation ¶
Index ¶
- Constants
- func GetKeyField(keyString string, v reflect.Value) reflect.Value
- func LoadArgs(args string, container interface{}) error
- func ParseCIDR(s string) (*net.IPNet, error)
- type CommonArgs
- type DNS
- type Error
- type IPConfig
- type IPNet
- type NetConf
- type Result
- type Route
- type UnmarshallableBool
- type UnmarshallableString
Constants ¶
const ( ErrUnknown uint = iota // 0 ErrIncompatibleCNIVersion // 1 ErrUnsupportedField // 2 )
Well known error codes see https://github.com/containernetworking/cni/blob/master/SPEC.md#well-known-error-codes
Variables ¶
This section is empty.
Functions ¶
func GetKeyField ¶
GetKeyField is a helper function to receive Values Values that represent a pointer to a struct
Types ¶
type CommonArgs ¶
type CommonArgs struct {
IgnoreUnknown UnmarshallableBool `json:"ignoreunknown,omitempty"`
}
CommonArgs contains the IgnoreUnknown argument and must be embedded by all Arg structs
type DNS ¶
type DNS struct { Nameservers []string `json:"nameservers,omitempty"` Domain string `json:"domain,omitempty"` Search []string `json:"search,omitempty"` Options []string `json:"options,omitempty"` }
DNS contains values interesting for DNS resolvers
type Error ¶
type IPConfig ¶
IPConfig contains values necessary to configure an interface
func (*IPConfig) MarshalJSON ¶
func (*IPConfig) UnmarshalJSON ¶
type IPNet ¶
like net.IPNet but adds JSON marshalling and unmarshalling
func (IPNet) MarshalJSON ¶
func (*IPNet) UnmarshalJSON ¶
type NetConf ¶
type NetConf struct { CNIVersion string `json:"cniVersion,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` IPAM struct { Type string `json:"type,omitempty"` } `json:"ipam,omitempty"` DNS DNS `json:"dns"` }
NetConf describes a network.
type Result ¶
type Result struct { IP4 *IPConfig `json:"ip4,omitempty"` IP6 *IPConfig `json:"ip6,omitempty"` DNS DNS `json:"dns,omitempty"` }
Result is what gets returned from the plugin (via stdout) to the caller
type UnmarshallableBool ¶
type UnmarshallableBool bool
UnmarshallableBool typedef for builtin bool because builtin type's methods can't be declared
func (*UnmarshallableBool) UnmarshalText ¶
func (b *UnmarshallableBool) UnmarshalText(data []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface. Returns boolean true if the string is "1" or "[Tt]rue" Returns boolean false if the string is "0" or "[Ff]alse"
type UnmarshallableString ¶ added in v0.4.0
type UnmarshallableString string
UnmarshallableString typedef for builtin string
func (*UnmarshallableString) UnmarshalText ¶ added in v0.4.0
func (s *UnmarshallableString) UnmarshalText(data []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface. Returns the string