Documentation ¶
Index ¶
- Constants
- func InitDeps(appConfig *c.Dev, cmd string, project *Project) error
- func RunComposeBuild(project string, composePaths []string, args ...string)
- func RunComposeDown(project string, composePaths []string, args ...string)
- func RunComposeLogs(project string, composePaths []string, args ...string)
- func RunComposePs(project string, composePaths []string, args ...string)
- func RunComposeUp(project string, composePaths []string, args ...string)
- func RunOnContainer(containerName string, cmds ...string)
- func SliceContainsString(slice []string, a string) bool
- func SliceInsertString(s []string, str string, index int) []string
- type Dependency
- type Network
- type Project
- type Registry
Constants ¶
const ( // BUILD constant referring to the build command of this project which // builds the project with docker-compose as specified in this tools // configuration file. BUILD = "build" // DOWN constant referring to the "down" command of this project which // stops and removes the project container. DOWN = "down" // PS constant referring to the "ps" command of this project which // shows the status of the containers used by the project. PS = "ps" // SH constant referring to the "sh" command of this project which runs // commands on the project container. SH = "sh" // UP constant referring to the "up" command of this project which // starts the project and any of the specified dependencies. UP = "up" )
Variables ¶
This section is empty.
Functions ¶
func RunComposeBuild ¶
RunComposeBuild runs docker-compose build with the specified docker compose files and args.
func RunComposeDown ¶
RunComposeDown runs docker-compose down with the specified docker compose files and args.
func RunComposeLogs ¶
RunComposeLogs runs docker-compose logs with the specified docker compose files and args.
func RunComposePs ¶
RunComposePs runs docker-compose ps with the specified docker compose files and args.
func RunComposeUp ¶
RunComposeUp runs docker-compose up with the specified docker compose files and args.
func RunOnContainer ¶
RunOnContainer runs the commands on the container with the specified name using the 'docker' command.
func SliceContainsString ¶
SliceContainsString checks the provided slice for the specified string and returns true if it was found, otherwise returns false.
Types ¶
type Dependency ¶
type Dependency interface { // PreRun does whatever is required of the dependency. It is run prior // to the specified command for the given project. PreRun(command string, appConfig *c.Dev, project *Project) // Dependencies returns the names of all the dev objects it depends on // in order to function. Dependencies() []string // Name of the depencency. Maps to the name given to the object in the // dev configuration file. GetName() string }
Dependency is the interface that is used by all objects in the dev configuration implement such that they can be used as a dependency by other objects of the configuration.
type Network ¶
type Network struct { Name string Config *types.NetworkCreate }
Network is an external docker network that dev manages.
func NewNetwork ¶
func NewNetwork(name string, config *types.NetworkCreate) *Network
NewNetwork is the Network constructor.
func (*Network) Dependencies ¶
Dependencies implements the Dependency interface. At this time a Network cannot have dependencies so it returns an empty slice.
func (*Network) GetName ¶
GetName returns the name of the network as named by the user in the configuration file.
type Project ¶
Project is the group of functionality provided by a docker-compose file.
func NewProject ¶
NewProject is the Project constructor.
func (*Project) Dependencies ¶
Dependencies implements the Depedency interface. It returns a list of the names of its dependencies. These can be names of other projects, networks or registries.
func (*Project) GetName ¶
GetName returns the name of the project as configured by the user in the dev configuration file.
func (*Project) PreRun ¶
PreRun implements the Dependency interface. It brings up the project prior to the shell and up commads.
type Registry ¶
Registry is a private container registry that dev will attempt to login to so images can be pulled from it.
func NewRegistry ¶
NewRegistry constructs Registry objects.
func (*Registry) Dependencies ¶
Dependencies implements the Dependency interface.