{"modulePath":"github.com/telecomposeio/docker-cli","version":"v0.0.0-20230330191823-de0d30ff24fa","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package convert\n\n## Constants\n\n```go\nconst (\n\n\t// LabelImage is the label used to store image name provided in the compose file\n\tLabelImage = \"com.docker.stack.image\"\n)\n```\n\n```go\nconst (\n\t// LabelNamespace is the label used to track stack resources\n\tLabelNamespace = \"com.docker.stack.namespace\"\n)\n```\n\n## Functions\n\n```go\nfunc AddStackLabel(namespace Namespace, labels map[string]string) map[string]string\n```\nAddStackLabel returns labels with the namespace label added\n\n```go\nfunc Configs(namespace Namespace, configs map[string]composetypes.ConfigObjConfig) ([]swarm.ConfigSpec, error)\n```\nConfigs converts config objects from the Compose type to the engine API type\n\n```go\nfunc Networks(namespace Namespace, networks networkMap, servicesNetworks map[string]struct{}) (map[string]types.NetworkCreate, []string)\n```\nNetworks from the compose-file type to the engine API type\n\n```go\nfunc Secrets(namespace Namespace, secrets map[string]composetypes.SecretConfig) ([]swarm.SecretSpec, error)\n```\nSecrets converts secrets from the Compose type to the engine API type\n\n```go\nfunc Service(\n\tapiVersion string,\n\tnamespace Namespace,\n\tservice composetypes.ServiceConfig,\n\tnetworkConfigs map[string]composetypes.NetworkConfig,\n\tvolumes map[string]composetypes.VolumeConfig,\n\tsecrets []*swarm.SecretReference,\n\tconfigs []*swarm.ConfigReference,\n) (swarm.ServiceSpec, error)\n```\nService converts a ServiceConfig into a swarm ServiceSpec\n\n```go\nfunc Services(\n\tnamespace Namespace,\n\tconfig *composetypes.Config,\n\tclient client.CommonAPIClient,\n) (map[string]swarm.ServiceSpec, error)\n```\nServices from compose-file types to engine API types\n\n```go\nfunc Volumes(serviceVolumes []composetypes.ServiceVolumeConfig, stackVolumes volumes, namespace Namespace) ([]mount.Mount, error)\n```\nVolumes from compose-file types to engine api types\n\n## Types\n\n```go\ntype Namespace struct {\n\t// contains filtered or unexported fields\n}\n```\nNamespace mangles names by prepending the name\n\n```go\nfunc NewNamespace(name string) Namespace\n```\nNewNamespace returns a new Namespace for scoping of names\n\n```go\nfunc (n Namespace) Descope(name string) string\n```\nDescope returns the name without the namespace prefix\n\n```go\nfunc (n Namespace) Name() string\n```\nName returns the name of the namespace\n\n```go\nfunc (n Namespace) Scope(name string) string\n```\nScope prepends the namespace to a name\n\n","path":"github.com/telecomposeio/docker-cli/cli/compose/convert","name":"convert","synopsis":"","isRedistributable":true}
