Documentation ¶
Index ¶
- func Convert(from types.Result, toVersion string) (types.Result, error)
- func Create(version string, bytes []byte) (types.Result, error)
- func RegisterConverter(fromVersion string, toVersions []string, convertFn ConvertFn)
- func RegisterCreator(versions []string, createFn ResultFactoryFunc)
- type ConvertFn
- type ResultFactoryFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert converts a CNI Result to the requested CNI specification version, or returns an error if the conversion could not be performed or failed
func Create ¶
Create creates a CNI Result using the given JSON, or an error if the creation could not be performed
func RegisterConverter ¶
RegisterConverter registers a CNI Result converter. SHOULD NOT BE CALLED EXCEPT FROM CNI ITSELF.
func RegisterCreator ¶
func RegisterCreator(versions []string, createFn ResultFactoryFunc)
RegisterCreator registers a CNI Result creator. SHOULD NOT BE CALLED EXCEPT FROM CNI ITSELF.
Types ¶
type ConvertFn ¶
ConvertFn should convert from the given arbitrary Result type into a Result implementing CNI specification version passed in toVersion. The function is guaranteed to be passed a Result type matching the fromVersion it was registered with, and is guaranteed to be passed a toVersion matching one of the toVersions it was registered with.