wire

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentToType

func ContentToType(content interface{}) string

ContentToType returns string representation for type of the content.

func ToStream added in v0.9.0

func ToStream(stream Stream) (*os.File, error)

ToStream converts stream value to stdin or stderr.

Types

type Config

type Config struct {
	// ConfigureSystem tells executor to mount standard mounts like /proc, /dev, /tmp ...  and configure DNS inside new root.
	ConfigureSystem bool

	// IP is the IP to assign executor to.
	IP *net.IPNet

	// Hostname is the hostname to set inside namespace.
	Hostname string

	// DNS is the list of DnS servers to configure inside namespace.
	DNS []net.IP

	// Hosts is the list of hosts and their IP addresses to resolve inside namespace.
	Hosts map[string]net.IP

	// Mounts is the list of bindings to apply inside container
	Mounts []Mount
}

Config stores configuration of executor

type DecoderFunc

type DecoderFunc func() (interface{}, error)

DecoderFunc is the decoding function.

func NewDecoder

func NewDecoder(r io.Reader, types []interface{}) DecoderFunc

NewDecoder creates new message decoder.

type EncoderFunc

type EncoderFunc func(content interface{}) error

EncoderFunc is the encoding function.

func NewEncoder

func NewEncoder(w io.Writer) EncoderFunc

NewEncoder creates new message encoder.

type Execute

type Execute struct {
	// Command is a command to execute
	Command string
}

Execute is sent to execute a shell command

type InflateDockerImage added in v0.8.0

type InflateDockerImage struct {
	// Path were cached downloads are stored.
	CacheDir string

	// Image is the name of the image.
	Image string

	// Tag is the tag of the image.
	Tag string
}

InflateDockerImage initializes filesystem by downloading and inflating docker image.

type Log

type Log struct {
	// Stream is the type of stream where log was produced
	Stream Stream

	// Text is text printed by command
	Text string
}

Log is the log message printed by executed command

type Mount

type Mount struct {
	// Location on Host
	Host string

	// Mountpoint inside container
	Container string

	// Writable makes mount writable inside container
	Writable bool
}

Mount defines directories to mount inside container

type Result

type Result struct {
	// Error is the error returned by command
	Error string
}

Result is sent once command finishes

type RunDockerContainer added in v0.9.0

type RunDockerContainer struct {
	// Path were cached downloads are stored.
	CacheDir string

	// Name is the name of the container.
	Name string

	// Image is the name of the image.
	Image string

	// Tag is the tag of the image.
	Tag string

	// EnvVars sets environment variables inside container.
	EnvVars map[string]string

	// User is the username or UID and group name or GID to use.
	User string

	// WorkingDir is the path to wrking drectory inside the container.
	WorkingDir string

	// Entrypoint for container.
	Entrypoint []string

	// Args is a list of arguments for the container.
	Args []string
}

RunDockerContainer runs docker container.

type Stream

type Stream int

Stream is the type of stream where log was produced

const (
	// StreamOut represents stdout
	StreamOut Stream = iota

	// StreamErr represents stderr
	StreamErr
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL