Documentation
¶
Index ¶
- Variables
- func MustDownloadFile(url, outFilePath string)
- func MustRunGoChecks(params *GoChecksParams)
- func MustRunGoTests(params *GoTestsParams)
- func NewDockerComposeConfigDeploy(memoryLimitMB int64, replicas uint64) *ct.DeployConfig
- func NewDockerComposeConfigExtraHosts(extraHostsMaps ...map[string]string) ct.HostsList
- func NewDockerComposeConfigHealthCheckShell(format string, a ...any) *ct.HealthCheckConfig
- func RestoreDefaultRuntimeGOOS()
- type DockerCompose
- func (d *DockerCompose) GetCommand() *shellz.Command
- func (d *DockerCompose) GetConfig() *ct.Config
- func (d *DockerCompose) GetDownCommand() *shellz.Command
- func (d *DockerCompose) GetMarshaledConfig() []byte
- func (d *DockerCompose) GetPSCommand() *shellz.Command
- func (d *DockerCompose) GetProfiles() []string
- func (d *DockerCompose) GetProjectName() string
- func (d *DockerCompose) GetUpCommand() *shellz.Command
- func (d *DockerCompose) WithProfiles(profiles ...string) *DockerCompose
- func (d *DockerCompose) WithProjectName(projectName string) *DockerCompose
- type DownloadError
- type GoChecksParams
- type GoTestsParams
- type GoTool
Constants ¶
This section is empty.
Variables ¶
var ( GoToolGoCov = NewGoTool("github.com/axw/gocov", "gocov", "v1.2.1") GoToolGoCovHTML = NewGoTool("github.com/matm/gocov-html", "cmd/gocov-html", "v1.4.0") GoToolGolint = NewGoTool("golang.org/x/lint", "golint", "v0.0.0-20210508222113-6edffad5e616") GoToolMockGen = NewGoTool("go.uber.org/mock", "/mockgen", "v0.5.0") GoToolStaticCheck = NewGoTool("honnef.co/go/tools", "cmd/staticcheck", "2024.1.1") )
Known Go tools.
var ( // DefaultRuntimeGOOS allows to inject different values of "runtime.GOOS" for tests. DefaultRuntimeGOOS = runtime.GOOS )
Functions ¶
func MustDownloadFile ¶ added in v0.5.0
func MustDownloadFile(url, outFilePath string)
MustDownloadFile downloads a file.
func MustRunGoChecks ¶
func MustRunGoChecks(params *GoChecksParams)
MustRunGoChecks runs a set of Go checks in the current working directory.
func MustRunGoTests ¶
func MustRunGoTests(params *GoTestsParams)
MustRunGoTests runs a set of Go tests in the current working directory.
func NewDockerComposeConfigDeploy ¶
func NewDockerComposeConfigDeploy(memoryLimitMB int64, replicas uint64) *ct.DeployConfig
NewDockerComposeConfigDeploy is a Docker Compose config helper.
func NewDockerComposeConfigExtraHosts ¶
NewDockerComposeConfigExtraHosts is a Docker Compose config helper.
func NewDockerComposeConfigHealthCheckShell ¶
func NewDockerComposeConfigHealthCheckShell(format string, a ...any) *ct.HealthCheckConfig
NewDockerComposeConfigHealthCheckShell is a Docker Compose config helper.
func RestoreDefaultRuntimeGOOS ¶
func RestoreDefaultRuntimeGOOS()
RestoreDefaultRuntimeGOOS restores the default value of DefaultRuntimeGOOS.
Types ¶
type DockerCompose ¶
type DockerCompose struct {
// contains filtered or unexported fields
}
DockerCompose helps operate a Docker Compose config.
func NewDockerCompose ¶
func NewDockerCompose(cfg *ct.Config) *DockerCompose
NewDockerCompose initializes a new Docker Compose.
func (*DockerCompose) GetCommand ¶
func (d *DockerCompose) GetCommand() *shellz.Command
GetCommand returns a pre-configured "docker compose" command.
func (*DockerCompose) GetConfig ¶
func (d *DockerCompose) GetConfig() *ct.Config
GetConfig returns the Docker Compose config.
func (*DockerCompose) GetDownCommand ¶
func (d *DockerCompose) GetDownCommand() *shellz.Command
GetDownCommand returns a pre-configured "docker compose down" command.
func (*DockerCompose) GetMarshaledConfig ¶
func (d *DockerCompose) GetMarshaledConfig() []byte
GetMarshaledConfig returns the Docker Compose config marshaled to YAML.
func (*DockerCompose) GetPSCommand ¶
func (d *DockerCompose) GetPSCommand() *shellz.Command
GetPSCommand returns a pre-configured "docker compose ps" command.
func (*DockerCompose) GetProfiles ¶
func (d *DockerCompose) GetProfiles() []string
GetProfiles returns the Docker Compose profiles if set.
func (*DockerCompose) GetProjectName ¶
func (d *DockerCompose) GetProjectName() string
GetProjectName returns the Docker Compose project name if set.
func (*DockerCompose) GetUpCommand ¶
func (d *DockerCompose) GetUpCommand() *shellz.Command
GetUpCommand returns a pre-configured "docker compose up" command.
func (*DockerCompose) WithProfiles ¶
func (d *DockerCompose) WithProfiles(profiles ...string) *DockerCompose
WithProfiles returns a clone of the Docker Compose with the given profiles set.
func (*DockerCompose) WithProjectName ¶
func (d *DockerCompose) WithProjectName(projectName string) *DockerCompose
WithProjectName returns a clone of the Docker Compose with the given project name set.
type DownloadError ¶ added in v0.5.0
type DownloadError struct {
// contains filtered or unexported fields
}
DownloadError describes a download error.
func NewDownloadError ¶ added in v0.5.0
func NewDownloadError(url string, statusCode int, message string) *DownloadError
NewDownloadError initializes a new download error.
func (*DownloadError) Error ¶ added in v0.5.0
func (e *DownloadError) Error() string
Error implements the error interface.
func (*DownloadError) GetStatusCode ¶ added in v0.5.0
func (e *DownloadError) GetStatusCode() int
GetStatusCode returns the status code.
func (*DownloadError) GetURL ¶ added in v0.5.0
func (e *DownloadError) GetURL() string
GetURL returns the URL.
type GoChecksParams ¶
GoChecksParams describes the parameters for running Go checks.
type GoTestsParams ¶
type GoTestsParams struct { AllPackages []string SelectedPackages []string BuildTags []string TestRegexp string IgnoreCache bool Verbose *bool CoverageDirPath string OpenCoverage bool }
GoTestsParams describes the parameters for running Go tests.
type GoTool ¶
type GoTool struct {
// contains filtered or unexported fields
}
GoTool describes a Go tool.
func MustLookupGoTool ¶
MustLookupGoTool returns a *GoTool
func (*GoTool) GetArgument ¶
GetArgument returns an argument string suitable for Go run.
func (*GoTool) GetCommand ¶
GetCommand returns a *shellz.Command for this Go tool.
func (*GoTool) GetVersion ¶
GetVersion returns the current Go tool defaultVersion (either pinned, or from go.mod).