engine

package
v0.0.0-...-64e6891 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: Apache-2.0 Imports: 3 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	io.Closer
	ID() string
	CloseAfterStream(stream *Stream) error
	Background() error
	Start(logPrefix string, logs io.Writer, restart <-chan time.Time) (status int64, err error)
	Shell(tty TTY, shell ...string) (err error)
	HealthCheck() <-chan string
	Commit(ref string) (imageID string, err error)
	UploadTarTo(tar io.Reader, path string) error
	StreamFileTo(stream Stream, path string) error
	StreamTarTo(stream Stream, path string) error
	StreamFileFrom(path string) (Stream, error)
	StreamTarFrom(path string) (Stream, error)
	Mkdir(path string) error
}

type ContainerConfig

type ContainerConfig struct {
	Name string

	// Internal
	Hostname   string
	User       string
	Image      string
	WorkingDir string
	Port       string
	Env        []string
	Entrypoint []string
	Cmd        []string
	SkipProxy  bool

	// External
	Binds        []string
	NetContainer string
	HostIP       string
	HostPort     string
	Memory       int64 // in bytes
	DiskQuota    int64 // in bytes

	// Healthcheck
	Test        []string
	Interval    time.Duration
	Timeout     time.Duration
	StartPeriod time.Duration
	Retries     int

	// Control
	Exit  <-chan struct{}  // default: inherit from engine
	Check <-chan time.Time // default: 1 second intervals
}

type Engine

type Engine interface {
	NewContainer(config *ContainerConfig) (Container, error)
	NewImage() Image
	Close() error
}

type EngineConfig

type EngineConfig struct {
	Proxy ProxyConfig
	Exit  <-chan struct{}
}

type Image

type Image interface {
	Build(tag string, dockerfile Stream) <-chan Progress
	Pull(ref string) <-chan Progress
	Push(ref string, creds RegistryCreds) <-chan Progress
	Delete(id string) error
}

type Progress

type Progress interface {
	Status() (string, error)
}

type ProxyConfig

type ProxyConfig struct {
	HTTPProxy   string
	HTTPSProxy  string
	NoProxy     string
	UseRemotely bool
}

type RegistryCreds

type RegistryCreds struct {
	Username      string `json:"username"`
	Password      string `json:"password"`
	Email         string `json:"email"`
	ServerAddress string `json:"serveraddress"`
}

type Stream

type Stream struct {
	io.ReadCloser
	*StreamState
}

func NewStream

func NewStream(data io.ReadCloser, size int64) Stream

func (Stream) Close

func (s Stream) Close() error

func (Stream) Out

func (s Stream) Out(dst io.Writer) error

type StreamState

type StreamState struct {
	Size int64
	// contains filtered or unexported fields
}

type TTY

type TTY interface {
	Run(remoteIn io.Reader, remoteOut io.WriteCloser, resize func(w, h uint16) error) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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