commands

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2022 Nethermind

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestRunBashScript added in v0.6.0

func TestRunBashScript(t *testing.T)

func TestRunCmd added in v0.6.0

func TestRunCmd(t *testing.T)

Types

type CMDRunnerOptions

type CMDRunnerOptions struct {
	// RunAsAdmin : True to run commands as admin
	RunAsAdmin bool
}

CMDRunnerOptions : Options for configuring a commands runner

type Command

type Command struct {
	// Cmd : command string
	Cmd string
	// GetOutput : get output of command
	GetOutput bool
}

Command : Represents a command

type CommandRunner

type CommandRunner interface {
	BuildDockerComposeUpCMD(options DockerComposeUpOptions) Command

	BuildDockerComposePullCMD(options DockerComposePullOptions) Command

	BuildDockerPSCMD(options DockerPSOptions) Command

	BuildDockerComposePSCMD(options DockerComposePsOptions) Command

	BuildDockerComposeLogsCMD(options DockerComposeLogsOptions) Command

	BuildDockerBuildCMD(options DockerBuildOptions) Command

	BuildDockerPullCMD(options DockerBuildOptions) Command

	BuildDockerInspectCMD(options DockerInspectOptions) Command

	BuildDockerComposeDownCMD(options DockerComposeDownOptions) Command

	BuildCreateFileCMD(options CreateFileOptions) Command

	BuildEchoToFileCMD(options EchoToFileOptions) Command

	RunCMD(cmd Command) (string, error)

	RunScript(script ScriptFile) (string, error)
}

func NewCMDRunner added in v0.6.0

func NewCMDRunner(options CMDRunnerOptions) CommandRunner

type CreateFileOptions added in v0.4.0

type CreateFileOptions struct {
	// FileName : path to file
	FileName string
}

CreateFileOptions : Represents create file command options

type DockerBuildOptions

type DockerBuildOptions struct {
	// Path : path to dockerfile
	Path string
	// Tag : docker build --tag tag
	Tag string
}

DockerBuildOptions : Represents docker build command options

type DockerComposeDownOptions

type DockerComposeDownOptions struct {
	// Path : path to docker-compose.yaml
	Path string
}

DockerComposeDownOptions : Represents docker compose down command options

type DockerComposeLogsOptions

type DockerComposeLogsOptions struct {
	// Path : path to docker-compose.yaml
	Path string
	// Services : services names
	Services []string
	// Follow : use with --follow
	Follow bool
	// Tail : if greater than 0 and Follow is False used for --tail
	Tail int
}

DockerComposeLogsOptions : Represents docker compose log command options

type DockerComposePsOptions

type DockerComposePsOptions struct {
	// Path : path to docker-compose.yaml
	Path string
	// Services : use with --services to display services
	Services bool
	// Quiet : use with --quietto display only IDs
	Quiet bool
	// ServiceName: Service argument
	ServiceName string
	// FilterRunning : use with --filter status=running
	FilterRunning bool
}

DockerComposePsOptions : Represents docker compose ps command options

type DockerComposePullOptions added in v0.5.0

type DockerComposePullOptions struct {
	// Path to the docker-compose.yaml
	Path string
	// Services names
	Services []string
}

DockerComposePullOptions represents 'docker compose pull' command options

type DockerComposeUpOptions

type DockerComposeUpOptions struct {
	// Path : path to docker-compose.yaml
	Path string
	// Services : services names
	Services []string
}

DockerComposeUpOptions : Represent docker compose up command options

type DockerInspectOptions

type DockerInspectOptions struct {
	// Name : docker object name
	Name string
	// Format : Go template for --format flag
	Format string
}

DockerInspectOptions : Represents docker inspect command options

type DockerPSOptions

type DockerPSOptions struct {
	// All : use with --all
	All bool
}

DockerPSOptions : Represent docker ps command options

type EchoToFileOptions added in v0.4.0

type EchoToFileOptions struct {
	// FileName : path to file
	FileName string
	// Content : content to be written to file
	Content string
}

EchoToFileOptions : Represents echo to file command options

type ScriptFile added in v0.6.0

type ScriptFile struct {
	// Tmp : script template
	Tmp *template.Template
	// getOutput : get output of the script
	GetOutput bool
	// Data: template data object
	Data interface{}
}

ScriptFile : Represents a bash or bat script to be executed

type WindowsCMDRunner added in v0.6.0

type WindowsCMDRunner struct {
	// contains filtered or unexported fields
}

func (*WindowsCMDRunner) BuildCreateFileCMD added in v0.6.0

func (cr *WindowsCMDRunner) BuildCreateFileCMD(options CreateFileOptions) Command

func (*WindowsCMDRunner) BuildDockerBuildCMD added in v0.6.0

func (cr *WindowsCMDRunner) BuildDockerBuildCMD(options DockerBuildOptions) Command

func (*WindowsCMDRunner) BuildDockerComposeDownCMD added in v0.6.0

func (cr *WindowsCMDRunner) BuildDockerComposeDownCMD(options DockerComposeDownOptions) Command

func (*WindowsCMDRunner) BuildDockerComposeLogsCMD added in v0.6.0

func (cr *WindowsCMDRunner) BuildDockerComposeLogsCMD(options DockerComposeLogsOptions) Command

func (*WindowsCMDRunner) BuildDockerComposePSCMD added in v0.6.0

func (cr *WindowsCMDRunner) BuildDockerComposePSCMD(options DockerComposePsOptions) Command

func (*WindowsCMDRunner) BuildDockerComposePullCMD added in v0.6.0

func (cr *WindowsCMDRunner) BuildDockerComposePullCMD(options DockerComposePullOptions) Command

func (*WindowsCMDRunner) BuildDockerComposeUpCMD added in v0.6.0

func (cr *WindowsCMDRunner) BuildDockerComposeUpCMD(options DockerComposeUpOptions) Command

func (*WindowsCMDRunner) BuildDockerInspectCMD added in v0.6.0

func (cr *WindowsCMDRunner) BuildDockerInspectCMD(options DockerInspectOptions) Command

func (*WindowsCMDRunner) BuildDockerPSCMD added in v0.6.0

func (cr *WindowsCMDRunner) BuildDockerPSCMD(options DockerPSOptions) Command

func (*WindowsCMDRunner) BuildDockerPullCMD added in v0.6.0

func (cr *WindowsCMDRunner) BuildDockerPullCMD(options DockerBuildOptions) Command

func (*WindowsCMDRunner) BuildEchoToFileCMD added in v0.6.0

func (cr *WindowsCMDRunner) BuildEchoToFileCMD(options EchoToFileOptions) Command

func (*WindowsCMDRunner) RunCMD added in v0.6.0

func (cr *WindowsCMDRunner) RunCMD(cmd Command) (string, error)

func (*WindowsCMDRunner) RunScript added in v0.6.0

func (cr *WindowsCMDRunner) RunScript(script ScriptFile) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL