Documentation
¶
Index ¶
- func ConnectLogChannel(cmdPlus *execplus.CmdPlus, logger *Logger)
- func CreateEmptyDirectory(dir string) error
- func DoesDirectoryExist(dirPath string) (bool, error)
- func DoesFileExist(filePath string) (bool, error)
- func DoesStringArrayContain(strings []string, targetString string) bool
- func GetHomeDirectory() (string, error)
- func GetServiceExitCode(role, dockerComposeLog string) (int, error)
- func GetSubdirectories(dirPath string) (result []string, err error)
- func IsEmptyFile(filePath string) (bool, error)
- func JoinStringMaps(maps ...map[string]string) map[string]string
- func JoinStringSlices(slices ...[]string) []string
- func Merge(map1 map[string]string, map2 map[string]string)
- func MoveDirectory(srcPath, destPath string) error
- func NormalizeDockerComposeLog(line string) string
- func ParseCommand(command string) ([]string, error)
- func ParseDockerComposeLog(role, line string) (string, string)
- func Run(dir string, commandWords ...string) (string, error)
- func RunAndLog(dir string, env []string, logger *Logger, commandWords ...string) error
- func RunSeries(dir string, commands [][]string) error
- func Strip(regex, text string) string
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectLogChannel ¶
ConnectLogChannel connects a log channel that wants to receive only each new output
func CreateEmptyDirectory ¶
CreateEmptyDirectory creates an empty dir directory and returns an error if any
func DoesDirectoryExist ¶
DoesDirectoryExist returns true if the directory dirPath is an existing directory, and false otherwise
func DoesFileExist ¶
DoesFileExist returns true if the file filePath exists, and false otherwise
func DoesStringArrayContain ¶
DoesStringArrayContain returns whether the given string slice contains the given string.
func GetHomeDirectory ¶
GetHomeDirectory returns the path to the user's home directory
func GetServiceExitCode ¶
GetServiceExitCode parses the given docker-compose output and returns the exit code of the given service and an error if any
func GetSubdirectories ¶
GetSubdirectories returns a slice of subdirectories in the directory dirPath
func IsEmptyFile ¶
IsEmptyFile returns true if filePath is an empty file, and false otherwise
func JoinStringMaps ¶
JoinStringMaps joins the given string maps
func JoinStringSlices ¶
JoinStringSlices joins the given slices
func MoveDirectory ¶
MoveDirectory moves srcPath to destPath
func NormalizeDockerComposeLog ¶
NormalizeDockerComposeLog removes colors, control characters, and converts carriage returns to newlines
func ParseCommand ¶
ParseCommand parses the command string into a string array
func ParseDockerComposeLog ¶
ParseDockerComposeLog parses the given docker-compose output and returns the service name and service output
func Run ¶
Run runs the given command, waits for the process to finish and returns the output string and error (if any)
func RunAndLog ¶
RunAndLog runs the given command, logs the process to the given channel, waits for the process to finish and returns an error (if any)
Types ¶
type Logger ¶ added in v0.26.3
type Logger struct {
Roles []string
SilencedRoles []string
Length int
Colors map[string]color.Attribute
Writer io.Writer
DefaultRole string
}
Logger represents a logger