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 Semver = "0.0.0"
Semver is the semantic version of forge. Meant to be be overridden at build time.
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"` }
type ContainerRuntime ¶
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 ¶
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 digests match, their resulting Metals should be the same. Because of this, Ores can be cached, using said Digest as the key.
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
|
|