forge

package module
v0.0.0-...-1173b46 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

README

Forge

Linux Build Status Windows Build Status GoDoc

Forge is a library for creating and running Cloud Foundry apps in Docker.

Notes

  • The API provided by Forge is not stable and may change without notice.
  • Forge is not yet intended for production use and is offered without warranty.

TODO

  • Add warnings about mismatched Docker client / server versions

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Name       string            `yaml:"name"`
	Buildpack  string            `yaml:"buildpack,omitempty"`
	Buildpacks []string          `yaml:"buildpacks,omitempty"`
	Command    string            `yaml:"command,omitempty"`
	DiskQuota  string            `yaml:"disk_quota,omitempty"`
	Memory     string            `yaml:"memory,omitempty"`
	StagingEnv map[string]string `yaml:"staging_env,omitempty"`
	RunningEnv map[string]string `yaml:"running_env,omitempty"`
	Env        map[string]string `yaml:"env,omitempty"`
	Services   Services          `yaml:"services,omitempty"`
}

type Buildpack

type Buildpack struct {
	Name       string
	URL        string
	VersionURL string
}

type Buildpacks

type Buildpacks []Buildpack

type Colorizer

type Colorizer func(string, ...interface{}) string

type Container

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

type ExportConfig

type ExportConfig struct {
	Droplet   engine.Stream
	Lifecycle engine.Stream
	Stack     string
	Ref       string
	AppConfig *AppConfig
}

type Forward

type Forward struct {
	Name string
	From string
	To   string
}

type ForwardConfig

type ForwardConfig struct {
	AppName          string
	Stack            string
	SSHPass          engine.Stream
	Color            Colorizer
	Details          *ForwardDetails
	HostIP, HostPort string
	Wait             <-chan time.Time
}

type ForwardDetails

type ForwardDetails struct {
	Host     string
	Port     string
	User     string
	Code     func() (string, error)
	Forwards []Forward
}

type Forwarder

type Forwarder struct {
	Logs io.Writer
	// contains filtered or unexported fields
}

func NewForwarder

func NewForwarder(client *docker.Client) *Forwarder

func (*Forwarder) Forward

func (f *Forwarder) Forward(config *ForwardConfig) (health <-chan string, done func(), id string, err error)

type Loader

type Loader interface {
	Loading(message string, progress <-chan engine.Progress) error
}

type NetworkConfig

type NetworkConfig struct {
	ContainerID string
	HostIP      string
	HostPort    string
}

type ReadResetWriter

type ReadResetWriter interface {
	io.ReadWriter
	Reset() error
}

type RunConfig

type RunConfig struct {
	Droplet       engine.Stream
	Lifecycle     engine.Stream
	Stack         string
	AppDir        string
	RSync         bool
	Shell         bool
	Restart       <-chan time.Time
	Color         Colorizer
	AppConfig     *AppConfig
	NetworkConfig *NetworkConfig
}

type Runner

type Runner struct {
	Logs   io.Writer
	TTY    engine.TTY
	Loader Loader
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(client *docker.Client, exit <-chan struct{}) *Runner

func (*Runner) Export

func (r *Runner) Export(config *ExportConfig) (imageID string, err error)

func (*Runner) Run

func (r *Runner) Run(config *RunConfig) (status int64, err error)

type Service

type Service struct {
	Name           string                 `json:"name" yaml:"name"`
	Label          string                 `json:"label" yaml:"label"`
	Tags           []string               `json:"tags" yaml:"tags"`
	Plan           string                 `json:"plan" yaml:"plan"`
	Credentials    map[string]interface{} `json:"credentials" yaml:"credentials"`
	SyslogDrainURL *string                `json:"syslog_drain_url" yaml:"syslog_drain_url,omitempty"`
	Provider       *string                `json:"provider" yaml:"provider,omitempty"`
	VolumeMounts   []string               `json:"volume_mounts" yaml:"volume_mounts,omitempty"`
}

type Services

type Services map[string][]Service

type StageConfig

type StageConfig struct {
	AppTar        io.Reader
	Cache         ReadResetWriter
	CacheEmpty    bool
	BuildpackZips map[string]engine.Stream
	Stack         string
	AppDir        string
	ForceDetect   bool
	RSync         bool
	Color         Colorizer
	AppConfig     *AppConfig
}

type Stager

type Stager struct {
	ImageTag         string
	SystemBuildpacks Buildpacks
	Logs             io.Writer
	Loader           Loader
	// contains filtered or unexported fields
}

func NewStager

func NewStager(client *docker.Client, httpClient *http.Client, exit <-chan struct{}) *Stager

func (*Stager) Download

func (s *Stager) Download(path, stack string) (stream engine.Stream, err error)

func (*Stager) DownloadTar

func (s *Stager) DownloadTar(path, stack string) (stream engine.Stream, err error)

func (*Stager) Stage

func (s *Stager) Stage(config *StageConfig) (droplet engine.Stream, err error)

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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