Documentation ¶
Index ¶
- Variables
- func GetSemver() string
- func WithLogger(ctx context.Context, logger Logger) context.Context
- type Container
- type ContainerConfig
- func (*ContainerConfig) Descriptor() ([]byte, []int)deprecated
- func (x *ContainerConfig) GetCmd() []string
- func (x *ContainerConfig) GetEntrypoint() []string
- func (x *ContainerConfig) GetEnv() []string
- func (x *ContainerConfig) GetMounts() []*Mount
- func (x *ContainerConfig) GetPrivileged() bool
- func (x *ContainerConfig) GetUser() string
- func (x *ContainerConfig) GetWorkingDir() string
- func (*ContainerConfig) ProtoMessage()
- func (x *ContainerConfig) ProtoReflect() protoreflect.Message
- func (x *ContainerConfig) Reset()
- func (x *ContainerConfig) String() string
- type ContainerRuntime
- type Drains
- type FileDescriptor
- type Foundry
- type Image
- type Logger
- type Metal
- type Mount
- type Ore
- type Streams
- type Volume
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultDetachKeys are the default key combinations // to use when detaching from a Container that has // been attached to. DefaultDetachKeys = "ctrl-d" )
var File_container_config_proto protoreflect.FileDescriptor
var File_metal_proto protoreflect.FileDescriptor
var File_mount_proto protoreflect.FileDescriptor
var ( // Semver is the semantic version of forge. // Meant to be be overridden at build time. Semver = "0.0.0" )
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 `protobuf:"bytes,1,rep,name=entrypoint,proto3" json:"entrypoint,omitempty"` Cmd []string `protobuf:"bytes,2,rep,name=cmd,proto3" json:"cmd,omitempty"` WorkingDir string `protobuf:"bytes,3,opt,name=working_dir,json=workingDir,proto3" json:"working_dir,omitempty"` Env []string `protobuf:"bytes,4,rep,name=env,proto3" json:"env,omitempty"` User string `protobuf:"bytes,5,opt,name=user,proto3" json:"user,omitempty"` Privileged bool `protobuf:"varint,6,opt,name=privileged,proto3" json:"privileged,omitempty"` Mounts []*Mount `protobuf:"bytes,7,rep,name=mounts,proto3" json:"mounts,omitempty"` // contains filtered or unexported fields }
func (*ContainerConfig) Descriptor
deprecated
func (*ContainerConfig) Descriptor() ([]byte, []int)
Deprecated: Use ContainerConfig.ProtoReflect.Descriptor instead.
func (*ContainerConfig) GetCmd ¶
func (x *ContainerConfig) GetCmd() []string
func (*ContainerConfig) GetEntrypoint ¶
func (x *ContainerConfig) GetEntrypoint() []string
func (*ContainerConfig) GetEnv ¶
func (x *ContainerConfig) GetEnv() []string
func (*ContainerConfig) GetMounts ¶
func (x *ContainerConfig) GetMounts() []*Mount
func (*ContainerConfig) GetPrivileged ¶
func (x *ContainerConfig) GetPrivileged() bool
func (*ContainerConfig) GetUser ¶
func (x *ContainerConfig) GetUser() string
func (*ContainerConfig) GetWorkingDir ¶
func (x *ContainerConfig) GetWorkingDir() string
func (*ContainerConfig) ProtoMessage ¶
func (*ContainerConfig) ProtoMessage()
func (*ContainerConfig) ProtoReflect ¶
func (x *ContainerConfig) ProtoReflect() protoreflect.Message
func (*ContainerConfig) Reset ¶
func (x *ContainerConfig) Reset()
func (*ContainerConfig) String ¶
func (x *ContainerConfig) String() string
type ContainerRuntime ¶
type Drains ¶
Drains represents only outward streams from an Ore, namely stdout and stderr.
type FileDescriptor ¶
type FileDescriptor interface {
Fd() uintptr
}
FileDescriptor is an interface to check io.Readers and io.Writers against to inspect if they are terminals.
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) 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 Metal ¶
type Metal struct { ExitCode int64 `protobuf:"varint,1,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` // contains filtered or unexported fields }
func (*Metal) Descriptor
deprecated
func (*Metal) GetExitCode ¶
func (*Metal) ProtoMessage ¶
func (*Metal) ProtoMessage()
func (*Metal) ProtoReflect ¶
func (x *Metal) ProtoReflect() protoreflect.Message
type Mount ¶
type Mount struct { Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"` // contains filtered or unexported fields }
func (*Mount) Descriptor
deprecated
func (*Mount) GetDestination ¶
func (*Mount) ProtoMessage ¶
func (*Mount) ProtoMessage()
func (*Mount) ProtoReflect ¶
func (x *Mount) ProtoReflect() protoreflect.Message
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. |
pkg
|
|