Documentation ¶
Overview ¶
Package container for dealing with containers via dagger
Package container for dealing with containers via dagger
Index ¶
- Variables
- func GetArtifacts(ctx context.Context, container *dagger.Container, artifacts *[]Artifacts) error
- func OpenSSH(ctx context.Context, client *dagger.Client, container *dagger.Container, ...) error
- func Setup(ctx context.Context, client *dagger.Client, opts *SetupOpts, ...) (*dagger.Container, error)
- type Artifacts
- type OptsOpenSSH
- type SettingsSSH
- type SetupOpts
Constants ¶
This section is empty.
Variables ¶
var ErrParseAddress = errors.New("could not parse address string")
ErrParseAddress is raised when containers IP address could not be parsed
Functions ¶
func GetArtifacts ¶
GetArtifacts extracts files from container to host Either both ContainerDir and HostDir must be directories, or both must be files
Types ¶
type Artifacts ¶
type Artifacts struct { ContainerPath string // Path inside container ContainerDir bool // Is ^^^ path directory? HostPath string // Path inside host HostDir bool // Is ^^^ path directory? }
Artifacts is passes to GetArtifacts as argument, and specifies extraction of files form container at containerDir to host at hostDir
type OptsOpenSSH ¶
type OptsOpenSSH struct { WaitFunc func() // Waiting function holding container with SSH running Password string // Filled in by OpenSSH function IPv4 string // Filled in by OpenSSH function Port string // Filled in by OpenSSH function MutexData *sync.Mutex // Mutex for modifying data in this struct // We could do with single channel here, but for clarity and less mental overhead there are 2 TunnelClose chan (bool) // Channel to signal that SSH tunnel is ready TunnelReady chan (bool) // Channel to signal that SSH tunnel is not longer needed and can be closed }
OptsOpenSSH stores options for SSH tunnel for OpenSSH function
func NewSettingsSSH ¶
func NewSettingsSSH(opts ...SettingsSSH) *OptsOpenSSH
NewSettingsSSH returns a SettingsSSH
func (*OptsOpenSSH) Address ¶
func (s *OptsOpenSSH) Address(address string) error
Address function parses provided string and populates IPv4 and Port (port defaults to 22 if not found)
type SettingsSSH ¶
type SettingsSSH func(*OptsOpenSSH)
SettingsSSH is for functional option pattern
func WithWaitNone ¶
func WithWaitNone() SettingsSSH
WithWaitNone is one possible function to pass into OpenSSH It will not wait
func WithWaitPressEnter ¶
func WithWaitPressEnter() SettingsSSH
WithWaitPressEnter is one possible function to pass into OpenSSH It will wait until user presses ENTER key to shutdown the container
type SetupOpts ¶
type SetupOpts struct { ContainerURL string // URL or name of docker container MountHostDir string // Directory from host to mount into container MountContainerDir string // Where to mount ^^^ host directory inside container WorkdirContainer string // Workdir of the container, specified by GITHUB_WORKSPACE environment variable ContainerInputDir string // Directory for input files InputDirs []string // List of directories to copy into container InputFiles []string // List of files to copy into container }
SetupOpts congregates options for Setup function None of the values can be empty string, and mountContainerDir cannot be '.' or '/'