Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultDetachKeys = "ctrl-d"
DefaultDetachKeys are the default key combinations to use when detaching from a Container that has been attached to.
var VersionCore = "0.15.0-alpha1"
VersionCore is the SemVer version core of forge. Meant to be be overridden at build time, but kept up-to-date sometimes to best support `go install`.
Functions ¶
Types ¶
type Container ¶
type Container interface { GetID() string CopyTo(context.Context, string, io.Reader) error CopyFrom(context.Context, string) (io.ReadCloser, error) Run(context.Context, *Streams) (int, error) Start(context.Context) error Restart(context.Context) error Exec(context.Context, *ContainerConfig, *Streams) (int, error) Stop(context.Context) error Remove(context.Context) error Kill(context.Context) error }
Container represents a container created by a ContainerRuntime.
type ContainerConfig ¶
type ContainerConfig struct { Entrypoint []string `json:"entrypoint,omitempty"` Cmd []string `json:"cmd,omitempty"` WorkingDir string `json:"working_dir,omitempty"` Env []string `json:"env,omitempty"` User string `json:"user,omitempty"` Privileged bool `json:"privileged,omitempty"` Mounts []Mount `json:"mounts,omitempty"` }
ContainerConfig is the configuration that is used to create a container or an exec in a running container.
type ContainerRuntime ¶
type ContainerRuntime interface { GetContainer(context.Context, string) (Container, error) CreateContainer(context.Context, Image, *ContainerConfig) (Container, error) PullImage(context.Context, string) (Image, error) CreateVolume(context.Context, string) (Volume, error) Close() error }
ContainerRuntime represents the functionality needed by Ores to pull OCI images and run containers when being processed.
type Drains ¶
Drains represents only outward streams from an Ore, namely stdout and stderr.
type Foundry ¶
type Foundry struct {
ContainerRuntime
}
Foundry is a wrapper around a ContainerRuntime for processing Ores.
func NewFoundry ¶
func NewFoundry(containerRuntime ContainerRuntime) *Foundry
NewFoundry returns a Foundry.
type Image ¶
type Image interface { Manifest() (*imagespecsv1.Manifest, error) Config() (*imagespecsv1.ImageConfig, error) Digest() (digest.Digest, error) Blob() io.Reader Name() string }
Image represents a image pulled by a ContainerRuntime. Used to create Containers from.
type Logger ¶
Logger is an alias to logr.Logger in case the logging library is desired to be swapped out.
func LoggerFrom ¶
LoggerFrom returns a Logger embedded within the given Context or a no-op Logger if no such Logger exists.
type Ore ¶
type Ore interface {
Liquify(context.Context, ContainerRuntime, *Drains) error
}
Ore represents one or more sequential containerized commands. Ores are meant to represent the entire input to said commands, so that if two Ore's match, their results should be the same. Because of this, Ores can be cached.
type Streams ¶
Streams represents streams to and from a process inside of a Container.
func StdStreams ¶
func StdStreams() *Streams
StdStreams returns a Streams consisting of os.Stdin, os.Stdout and os.Stderr.
func StdTerminalStreams ¶
StdTerminalStreams creates a Streams with os.Stdin, os.Stdout and os.Stderr made raw and a restore function to return them to their previous state. For use with attaching to a shell inside of a Container.
func TerminalStreams ¶
TerminalStreams creates a Streams with each of the given streams that is a terminal made raw and a restore function to return them to their previous states. For use with attaching to a shell inside of a Container.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
contaminate
package contaminate contains ways for forge to internally pass state between ores, such as to make sequential ores share a filesystem.
|
package contaminate contains ways for forge to internally pass state between ores, such as to make sequential ores share a filesystem. |
runtime
|
|