Documentation
¶
Index ¶
- func CommandAndEnvFromArgs(args []string) ([]string, []string)
- func NewServiceCmd(name string, long string, aliases []string) *cobra.Command
- func NewServiceCommandCmd(service string, command string) *cobra.Command
- func NewServiceCreateCmd(name string) *cobra.Command
- func NewServiceDestroyCmd(name string) *cobra.Command
- func NewServiceExecCmd(name string, service string) *cobra.Command
- func NewServiceResumeCmd(name string) *cobra.Command
- func NewServiceSuspendCmd(name string) *cobra.Command
- func NewServicesCmd(groupName string, long string, aliases []string) *cobra.Command
- func NewWhereCmd(description string, pathProvider WherePathProvider) *cobra.Command
- func UserAndGroupForDockerExecution() string
- type DockerComposeCommand
- type DockerComposeFile
- type DockerExecCommand
- type MWDD
- func (m MWDD) Directory() string
- func (m MWDD) DockerComposeFileExistsOrExit(fileName string)
- func (m MWDD) DockerComposeFileName(name string) string
- func (m MWDD) DockerComposeFileServices(fileName string) []string
- func (m MWDD) DockerComposeFileVolumes(fileName string) []string
- func (m MWDD) DockerComposeProjectName() string
- func (m MWDD) DockerExec(command DockerExecCommand)
- func (m MWDD) DockerRun(command DockerExecCommand)
- func (m MWDD) DownWithVolumesAndOrphans()
- func (m MWDD) EnsureReady()
- func (m MWDD) Env() dotenv.File
- func (m MWDD) Exec(service string, commandAndArgs []string, user string)
- func (m MWDD) ExecNoOutput(service string, commandAndArgs []string, user string) error
- func (m MWDD) RecordHostUsageBySite(host string)
- func (m MWDD) Rm(services []string)
- func (m MWDD) RmVolumes(dcVolumes []string)
- func (m MWDD) ServicesWithStatus(statusFilter string) []string
- func (m MWDD) Start(services []string)
- func (m MWDD) Stop(services []string)
- func (m MWDD) UpDetached(services []string)
- func (m MWDD) UsedHosts() []string
- type Service
- type WherePathProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandAndEnvFromArgs ¶
CommandAndEnvFromArgs taks arguments passed to a cobra command and extracts any prefixing env var definitions from them
func NewServiceCmd ¶
NewServiceCmd a new command for a single service, such as mailhog
func NewServiceCommandCmd ¶
func NewServiceCreateCmd ¶
func NewServiceDestroyCmd ¶
func NewServiceResumeCmd ¶
func NewServiceSuspendCmd ¶
func NewServicesCmd ¶
NewServicesCmd a new command for a set of grouped services, such as various flavours of shellbox
func NewWhereCmd ¶
func NewWhereCmd(description string, pathProvider WherePathProvider) *cobra.Command
func UserAndGroupForDockerExecution ¶
func UserAndGroupForDockerExecution() string
UserAndGroupForDockerExecution gets a user and group id combination for the current user that can be used for execution.
Types ¶
type DockerComposeCommand ¶
type DockerComposeCommand struct { Command string CommandArguments []string NoOutput bool MWDD MWDD }
DockerComposeCommand results in something like: `docker-compose <automatic project stuff> <command> <commandArguments>`.
func (DockerComposeCommand) RunTTY ¶
func (dcc DockerComposeCommand) RunTTY()
type DockerComposeFile ¶
type DockerComposeFile struct { Version string `yaml:"version"` Services map[string]Service `json:"services"` Volumes map[string]interface{} `json:"volumes"` }
func (DockerComposeFile) ServiceNames ¶
func (dcf DockerComposeFile) ServiceNames() []string
func (DockerComposeFile) VolumeNames ¶
func (dcf DockerComposeFile) VolumeNames() []string
type DockerExecCommand ¶
type DockerExecCommand struct { DockerComposeService string Command []string Env []string WorkingDir string User string }
DockerExecCommand to be run with Docker, which directly uses the docker SDK.
type MWDD ¶
type MWDD string
MWDD representation of a mwdd v2 setup.
func DefaultForUser ¶
func DefaultForUser() MWDD
DefaultForUser returns the default mwdd working directory for the user.
func (MWDD) DockerComposeFileExistsOrExit ¶
func (MWDD) DockerComposeFileName ¶
func (MWDD) DockerComposeFileServices ¶
func (MWDD) DockerComposeFileVolumes ¶
func (MWDD) DockerComposeProjectName ¶
DockerComposeProjectName the name of the docker-compose project.
func (MWDD) DockerExec ¶
func (m MWDD) DockerExec(command DockerExecCommand)
DockerExec runs a docker exec command using the docker SDK.
func (MWDD) DockerRun ¶
func (m MWDD) DockerRun(command DockerExecCommand)
DockerRun runs a docker container using the docker SDK attached to the mwdd network etc...
func (MWDD) DownWithVolumesAndOrphans ¶
func (m MWDD) DownWithVolumesAndOrphans()
DownWithVolumesAndOrphans runs `docker-compose down --volumes --remove-orphans`.
func (MWDD) ExecNoOutput ¶
ExecNoOutput runs `docker-compose exec -T <service> <commandAndArgs>` with no output.
func (MWDD) RecordHostUsageBySite ¶
RecordHostUsageBySite records a host in a local file as used at some point.
func (MWDD) RmVolumes ¶
RmVolumes runs `docker volume rm <volume names with docker-compose project prefixed>`.
func (MWDD) ServicesWithStatus ¶
ServicesWithStatus lists services in the docker-compose setup that have the given status
func (MWDD) UpDetached ¶
UpDetached runs `docker-compose up -d <services>`.
type WherePathProvider ¶
type WherePathProvider func() string