package convert
import "github.com/containernetworking/cni/pkg/types/internal"
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
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.
type ResultFactoryFunc ¶
Source Files ¶
- Version
- v1.3.0 (latest)
- Published
- Apr 7, 2025
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 5 days ago –
Tools for package owners.