{"modulePath":"github.com/docker/compose-cli","version":"v1.0.17","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package compose\n\n## Constants\n\n```go\nconst (\n\n\t// ComposeVersion Compose version\n\tComposeVersion = \"1.0-alpha\"\n)\n```\n\n## Functions\n\n```go\nfunc InDependencyOrder(ctx context.Context, project *types.Project, fn func(context.Context, types.ServiceConfig) error) error\n```\nInDependencyOrder applies the function to the services of the project taking in account the dependency order\n\n```go\nfunc InReverseDependencyOrder(ctx context.Context, project *types.Project, fn func(context.Context, types.ServiceConfig) error) error\n```\nInReverseDependencyOrder applies the function to the services of the project in reverse order of dependencies\n\n```go\nfunc NewComposeService(apiClient client.APIClient, configFile *configfile.ConfigFile) compose.Service\n```\nNewComposeService create a local implementation of the compose.Service API\n\n## Types\n\n```go\ntype Containers []moby.Container\n```\nContainers is a set of moby Container\n\n```go\ntype ContainersKey struct{}\n```\nContainersKey is the context key to access context value os a ContainersStatus\n\n```go\ntype ContainersState interface {\n\tGet(string) *types.Container\n\tGetContainers() Containers\n\tAdd(c types.Container)\n\tAddAll(cs Containers)\n\tRemove(string) types.Container\n}\n```\nContainersState state management interface\n\n```go\nfunc GetContextContainerState(ctx context.Context) (ContainersState, error)\n```\nGetContextContainerState gets the container state manager\n\n```go\nfunc NewContainersState(cs Containers) ContainersState\n```\nNewContainersState creates a new container state manager\n\n```go\ntype Graph struct {\n\tVertices map[string]*Vertex\n\t// contains filtered or unexported fields\n}\n```\nGraph represents project as service dependencies\n\n```go\nfunc NewGraph(services types.Services, initialStatus ServiceStatus) *Graph\n```\nNewGraph returns the dependency graph of the services\n\n```go\nfunc (g *Graph) AddEdge(source string, destination string) error\n```\nAddEdge adds a relationship of dependency between vertexes \\`source\\` and \\`destination\\`\n\n```go\nfunc (g *Graph) AddVertex(key string, service types.ServiceConfig, initialStatus ServiceStatus)\n```\nAddVertex adds a vertex to the Graph\n\n```go\nfunc (g *Graph) FilterChildren(key string, status ServiceStatus) []*Vertex\n```\nFilterChildren returns children of a certain vertex that are in a certain status\n\n```go\nfunc (g *Graph) FilterParents(key string, status ServiceStatus) []*Vertex\n```\nFilterParents returns the parents of a certain vertex that are in a certain status\n\n```go\nfunc (g *Graph) HasCycles() (bool, error)\n```\nHasCycles detects cycles in the graph\n\n```go\nfunc (g *Graph) Leaves() []*Vertex\n```\nLeaves returns the slice of leaves of the graph\n\n```go\nfunc (g *Graph) Roots() []*Vertex\n```\nRoots returns the slice of \"Roots\" of the graph\n\n```go\nfunc (g *Graph) UpdateStatus(key string, status ServiceStatus)\n```\nUpdateStatus updates the status of a certain vertex\n\n```go\ntype ServiceStatus int\n```\nServiceStatus indicates the status of a service\n\n```go\nconst (\n\tServiceStopped ServiceStatus = iota\n\tServiceStarted\n)\n```\nServices status flags\n\n```go\ntype Vertex struct {\n\tKey      string\n\tService  types.ServiceConfig\n\tStatus   ServiceStatus\n\tChildren map[string]*Vertex\n\tParents  map[string]*Vertex\n}\n```\nVertex represents a service in the dependencies structure\n\n```go\nfunc NewVertex(key string, service types.ServiceConfig, initialStatus ServiceStatus) *Vertex\n```\nNewVertex is the constructor function for the Vertex\n\n```go\nfunc (v *Vertex) GetChildren() []*Vertex\n```\nGetChildren returns a slice with the child vertexes of the a Vertex\n\n```go\nfunc (v *Vertex) GetParents() []*Vertex\n```\nGetParents returns a slice with the parent vertexes of the a Vertex\n\n","path":"github.com/docker/compose-cli/local/compose","name":"compose","synopsis":"","isRedistributable":true}
