convert

package
v26.1.5+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedRuntime returns an error if the runtime is not supported by the daemon
	ErrUnsupportedRuntime = errors.New("unsupported runtime")
	// ErrMismatchedRuntime returns an error if the runtime does not match the provided spec
	ErrMismatchedRuntime = errors.New("mismatched Runtime and *Spec fields")
)

Functions

func BasicNetworkCreateToGRPC

func BasicNetworkCreateToGRPC(create basictypes.NetworkCreateRequest) swarmapi.NetworkSpec

BasicNetworkCreateToGRPC converts a NetworkCreateRequest to a grpc NetworkSpec.

func BasicNetworkFromGRPC

func BasicNetworkFromGRPC(n swarmapi.Network) basictypes.NetworkResource

BasicNetworkFromGRPC converts a grpc Network to a NetworkResource.

func ConfigFromGRPC

func ConfigFromGRPC(s *swarmapi.Config) swarmtypes.Config

ConfigFromGRPC converts a grpc Config to a Config.

func ConfigReferencesFromGRPC

func ConfigReferencesFromGRPC(s []*swarmapi.ConfigReference) []*swarmtypes.ConfigReference

ConfigReferencesFromGRPC converts a slice of grpc ConfigReference to ConfigReference

func ConfigSpecToGRPC

func ConfigSpecToGRPC(s swarmtypes.ConfigSpec) swarmapi.ConfigSpec

ConfigSpecToGRPC converts Config to a grpc Config.

func GenericResourcesFromGRPC

func GenericResourcesFromGRPC(genericRes []*swarmapi.GenericResource) []types.GenericResource

GenericResourcesFromGRPC converts a GRPC GenericResource to a GenericResource

func GenericResourcesToGRPC

func GenericResourcesToGRPC(genericRes []types.GenericResource) []*swarmapi.GenericResource

GenericResourcesToGRPC converts a GenericResource to a GRPC GenericResource

func IsIngressNetwork

func IsIngressNetwork(n *swarmapi.Network) bool

IsIngressNetwork check if the swarm network is an ingress network

func IsolationFromGRPC

IsolationFromGRPC converts a swarm api container isolation to a moby isolation representation

func MergeSwarmSpecToGRPC

func MergeSwarmSpecToGRPC(s types.Spec, spec swarmapi.ClusterSpec) (swarmapi.ClusterSpec, error)

MergeSwarmSpecToGRPC merges a Spec with an initial grpc ClusterSpec

func NodeFromGRPC

func NodeFromGRPC(n swarmapi.Node) types.Node

NodeFromGRPC converts a grpc Node to a Node.

func NodeSpecToGRPC

func NodeSpecToGRPC(s types.NodeSpec) (swarmapi.NodeSpec, error)

NodeSpecToGRPC converts a NodeSpec to a grpc NodeSpec.

func SecretFromGRPC

func SecretFromGRPC(s *swarmapi.Secret) swarmtypes.Secret

SecretFromGRPC converts a grpc Secret to a Secret.

func SecretReferencesFromGRPC

func SecretReferencesFromGRPC(s []*swarmapi.SecretReference) []*swarmtypes.SecretReference

SecretReferencesFromGRPC converts a slice of grpc SecretReference to SecretReference

func SecretSpecToGRPC

func SecretSpecToGRPC(s swarmtypes.SecretSpec) swarmapi.SecretSpec

SecretSpecToGRPC converts Secret to a grpc Secret.

func ServiceFromGRPC

func ServiceFromGRPC(s swarmapi.Service) (types.Service, error)

ServiceFromGRPC converts a grpc Service to a Service.

func ServiceSpecToGRPC

func ServiceSpecToGRPC(s types.ServiceSpec) (swarmapi.ServiceSpec, error)

ServiceSpecToGRPC converts a ServiceSpec to a grpc ServiceSpec.

func SwarmFromGRPC

func SwarmFromGRPC(c swarmapi.Cluster) types.Swarm

SwarmFromGRPC converts a grpc Cluster to a Swarm.

func SwarmPluginGetter

func SwarmPluginGetter(pg plugingetter.PluginGetter) plugin.Getter

SwarmPluginGetter adapts a plugingetter.PluginGetter to a Swarmkit plugin.Getter.

func SwarmSpecToGRPC

func SwarmSpecToGRPC(s types.Spec) (swarmapi.ClusterSpec, error)

SwarmSpecToGRPC converts a Spec to a grpc ClusterSpec.

func TaskFromGRPC

func TaskFromGRPC(t swarmapi.Task) (types.Task, error)

TaskFromGRPC converts a grpc Task to a Task.

func VolumeCreateToGRPC

func VolumeCreateToGRPC(volume *volumetypes.CreateOptions) *swarmapi.VolumeSpec

VolumeCreateToGRPC takes a VolumeCreateBody and outputs the matching swarmapi VolumeSpec.

func VolumeFromGRPC

func VolumeFromGRPC(v *swarmapi.Volume) volumetypes.Volume

VolumeFromGRPC converts a swarmkit api Volume object to a docker api Volume object

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL