package types
import "github.com/containernetworking/cni/pkg/types"
Index ¶
- 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
- func (c *IPConfig) MarshalJSON() ([]byte, error)
- func (c *IPConfig) UnmarshalJSON(data []byte) error
- type IPNet
- type NetConf
- type Result
- type Route
- type UnmarshallableBool
Functions ¶
func GetKeyField ¶
GetKeyField is a helper function to receive Values Values that represent a pointer to a struct
func LoadArgs ¶
LoadArgs parses args from a string in the form "K=V;K2=V2;..."
func ParseCIDR ¶
ParseCIDR takes a string like "10.2.3.1/24" and return IPNet with "10.2.3.1" and /24 mask
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 Error struct { Code uint `json:"code"` Msg string `json:"msg"` Details string `json:"details,omitempty"` }
func (*Error) Error ¶
func (*Error) Print ¶
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 { 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
func (*Result) Print ¶
func (*Result) 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.
type Route ¶
func (*Route) MarshalJSON ¶
func (*Route) UnmarshalJSON ¶
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"
Source Files ¶
- Version
- v0.3.0
- Published
- Jun 2, 2016
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 1 week ago –
Tools for package owners.