{"modulePath":"github.com/docker/compose-cli","version":"v1.0.35","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package store\n\n## Constants\n\n```go\nconst (\n\t// DefaultContextName is an automatically generated local context\n\tDefaultContextName = \"default\"\n\t// DefaultContextType is the type for all moby contexts (not associated with cli backend)\n\tDefaultContextType = \"moby\"\n\n\t// AwsContextType is the type for aws contexts (currently a CLI plugin, not associated with cli backend)\n\t// to be removed with the cli plugin\n\tAwsContextType = \"aws\"\n\n\t// EcsContextType is the endpoint key in the context endpoints for an ECS\n\t// backend\n\tEcsContextType = \"ecs\"\n\n\t// EcsLocalSimulationContextType is the endpoint key in the context endpoints for an ECS backend\n\t// running local simulation endpoints\n\tEcsLocalSimulationContextType = \"ecs-local\"\n\n\t// AciContextType is the endpoint key in the context endpoints for an ACI\n\t// backend\n\tAciContextType = \"aci\"\n\t// LocalContextType is the endpoint key in the context endpoints for a new\n\t// local backend\n\tLocalContextType = \"local\"\n\t// KubeContextType is the endpoint key in the context endpoints for a new\n\t// kube backend\n\tKubeContextType = \"kube\"\n)\n```\n\n## Functions\n\n```go\nfunc WithContextStore(store Store)\n```\nWithContextStore adds the store to the context\n\n## Types\n\n```go\ntype AciContext struct {\n\tSubscriptionID string `json:\",omitempty\"`\n\tLocation       string `json:\",omitempty\"`\n\tResourceGroup  string `json:\",omitempty\"`\n}\n```\nAciContext is the context for the ACI backend\n\n```go\ntype AwsContext EcsContext\n```\nAwsContext is the context for the ecs plugin\n\n```go\ntype ContextMetadata struct {\n\tType              string\n\tDescription       string\n\tStackOrchestrator string\n\tAdditionalFields  map[string]interface{}\n}\n```\nContextMetadata is represtentation of the data we put in a context metadata\n\n```go\nfunc (dc ContextMetadata) MarshalJSON() ([]byte, error)\n```\nMarshalJSON implements custom JSON marshalling\n\n```go\nfunc (dc *ContextMetadata) UnmarshalJSON(payload []byte) error\n```\nUnmarshalJSON implements custom JSON marshalling\n\n```go\ntype DockerContext struct {\n\tName      string                 `json:\",omitempty\"`\n\tMetadata  ContextMetadata        `json:\",omitempty\"`\n\tEndpoints map[string]interface{} `json:\",omitempty\"`\n}\n```\nDockerContext represents the docker context metadata\n\n```go\nfunc (m *DockerContext) Type() string\n```\nType the context type\n\n```go\ntype EcsContext struct {\n\tCredentialsFromEnv bool   `json:\",omitempty\"`\n\tProfile            string `json:\",omitempty\"`\n}\n```\nEcsContext is the context for the AWS backend\n\n```go\ntype Endpoint struct {\n\tHost             string `json:\",omitempty\"`\n\tDefaultNamespace string `json:\",omitempty\"`\n}\n```\nEndpoint holds the Docker or the Kubernetes endpoint, they both have the \\`Host\\` property, only kubernetes will have the \\`DefaultNamespace\\`\n\n```go\ntype KubeContext struct {\n\tContextName     string `json:\",omitempty\"`\n\tKubeconfigPath  string `json:\",omitempty\"`\n\tFromEnvironment bool\n}\n```\nKubeContext is the context for a kube backend\n\n```go\ntype LocalContext struct{}\n```\nLocalContext is the context for the local backend\n\n```go\ntype Store interface {\n\t// Get returns the context with name, it returns an error if the  context\n\t// doesn't exist\n\tGet(name string) (*DockerContext, error)\n\t// GetEndpoint sets the `v` parameter to the value of the endpoint for a\n\t// particular context type\n\tGetEndpoint(name string, v interface{}) error\n\t// Create creates a new context, it returns an error if a context with the\n\t// same name exists already.\n\tCreate(name string, contextType string, description string, data interface{}) error\n\t// List returns the list of created contexts\n\tList() ([]*DockerContext, error)\n\t// Remove removes a context by name from the context store\n\tRemove(name string) error\n\t// ContextExists checks if a context already exists\n\tContextExists(name string) bool\n}\n```\nStore is the context store\n\n```go\nfunc Instance() Store\n```\nInstance returns the store from the context\n\n```go\nfunc New(rootDir string) (Store, error)\n```\nNew returns a configured context store with specified root dir (eg. $HOME/.docker) as root\n\n","path":"github.com/docker/compose-cli/api/context/store","name":"store","synopsis":"","isRedistributable":true}
