Documentation ¶
Overview ¶
Package golang provides a simple interface for building and testing Go projects.
Index ¶
- func GetContainer(ctx context.Context, runtime *daggers.Runtime, opts ...daggers.Option[config]) (*dagger.Container, error)
- func RunCommand(ctx context.Context, runtime *daggers.Runtime, opts ...daggers.Option[config]) (string, *dagger.Directory, error)
- func WithArgs(args ...string) daggers.Option[config]
- func WithContainerCustomizers(customizers ...containers.ContainerCustomizerFn) daggers.Option[config]
- func WithEnv(envMap map[string]string) daggers.Option[config]
- func WithGoImageRepo(repo string) daggers.Option[config]
- func WithGoImageTag(tag string) daggers.Option[config]
- func WithGoModCacheEnabled(enable bool) daggers.Option[config]
- func WithGoModDir(dir string) daggers.Option[config]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContainer ¶
func GetContainer( ctx context.Context, runtime *daggers.Runtime, opts ...daggers.Option[config], ) (*dagger.Container, error)
GetContainer returns a dagger container with given working directory and options.
func RunCommand ¶
func RunCommand( ctx context.Context, runtime *daggers.Runtime, opts ...daggers.Option[config], ) (string, *dagger.Directory, error)
RunCommand runs a go command with given working directory and options and returns command output and working directory.
func WithContainerCustomizers ¶
func WithContainerCustomizers(customizers ...containers.ContainerCustomizerFn) daggers.Option[config]
WithContainerCustomizers adds the container customizers to use for the container.
func WithGoImageRepo ¶
WithGoImageRepo sets whether to enable go module caching. Optional, defaults to docker.io/golang.
func WithGoImageTag ¶
WithGoImageTag sets the go image tag to use for the container. Optional, defaults to 1.19.
func WithGoModCacheEnabled ¶
WithGoModCacheEnabled sets whether to enable go module caching. Optional, defaults to true.
func WithGoModDir ¶
WithGoModDir sets the go module directory to use for the container. Optional, defaults to the current directory.
Types ¶
This section is empty.