docker

package
v0.0.0-...-cb0fbf9 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2015 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NAME    = Label("io.docker.compose.name")
	PROJECT = Label("io.docker.compose.project")
	SERVICE = Label("io.docker.compose.service")
	HASH    = Label("io.docker.compose.config-hash")
)

Variables

This section is empty.

Functions

func And

func And(left, right string) string

func CreateClient

func CreateClient(c ClientOpts) (dockerclient.Client, error)

func CreateTar

func CreateTar(p *project.Project, name string) (io.ReadCloser, error)

func Filter

func Filter(vs []string, f func(string) bool) []string

func GetContainerByName

func GetContainerByName(client dockerclient.Client, name string) (*dockerclient.Container, error)

func GetContainersByFilter

func GetContainersByFilter(client dockerclient.Client, filter ...string) ([]dockerclient.Container, error)

func NewProject

func NewProject(context *Context) (*project.Project, error)

func OneName

func OneName(client dockerclient.Client, project, service string) (string, error)

Types

type Builder

type Builder interface {
	Build(p *project.Project, service project.Service) (string, error)
}

type ClientFactory

type ClientFactory interface {
	// Create constructs a Docker client for the given service. The passed in
	// config may be nil in which case a generic client for the project should
	// be returned.
	Create(service project.Service) dockerclient.Client
}

func NewDefaultClientFactory

func NewDefaultClientFactory(opts ClientOpts) (ClientFactory, error)

type ClientOpts

type ClientOpts struct {
	TLS        bool
	TLSVerify  bool
	TLSOptions tlsconfig.Options
	TrustKey   string
	Host       string
}

type Container

type Container struct {
	project.EmptyService
	// contains filtered or unexported fields
}

func NewContainer

func NewContainer(client dockerclient.Client, name string, service *Service) *Container

func (*Container) Create

func (c *Container) Create(imageName string) (*dockerclient.Container, error)

func (*Container) Delete

func (c *Container) Delete() error

func (*Container) Down

func (c *Container) Down() error

func (*Container) Id

func (c *Container) Id() (string, error)

func (*Container) Info

func (c *Container) Info() (project.Info, error)

func (*Container) Kill

func (c *Container) Kill() error

func (*Container) Log

func (c *Container) Log() error

func (*Container) Name

func (c *Container) Name() string

func (*Container) OutOfSync

func (c *Container) OutOfSync() (bool, error)

func (*Container) Port

func (c *Container) Port(port string) (string, error)

func (*Container) Pull

func (c *Container) Pull() error

func (*Container) Restart

func (c *Container) Restart() error

func (*Container) Up

func (c *Container) Up(imageName string) error

type Context

type Context struct {
	project.Context
	Builder       Builder
	ClientFactory ClientFactory
	ConfigDir     string
	ConfigFile    *cliconfig.ConfigFile
}

func (*Context) LookupConfig

func (c *Context) LookupConfig() error

type DaemonBuilder

type DaemonBuilder struct {
	// contains filtered or unexported fields
}

func NewDaemonBuilder

func NewDaemonBuilder(context *Context) *DaemonBuilder

func (*DaemonBuilder) Build

func (d *DaemonBuilder) Build(p *project.Project, service project.Service) (string, error)

type Label

type Label string

func (Label) Eq

func (f Label) Eq(value string) string

func (Label) Str

func (f Label) Str() string

type Namer

type Namer interface {
	io.Closer
	Next() string
}

func NewNamer

func NewNamer(client dockerclient.Client, project, service string) Namer

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) Build

func (s *Service) Build() error

func (*Service) Config

func (s *Service) Config() *project.ServiceConfig

func (*Service) Containers

func (s *Service) Containers() ([]project.Container, error)

func (*Service) Create

func (s *Service) Create() error

func (*Service) Delete

func (s *Service) Delete() error

func (*Service) DependentServices

func (s *Service) DependentServices() []project.ServiceRelationship

func (*Service) Down

func (s *Service) Down() error

func (*Service) Info

func (s *Service) Info() (project.InfoSet, error)

func (*Service) Kill

func (s *Service) Kill() error

func (*Service) Log

func (s *Service) Log() error

func (*Service) Name

func (s *Service) Name() string

func (*Service) Pull

func (s *Service) Pull() error

func (*Service) Restart

func (s *Service) Restart() error

func (*Service) Scale

func (s *Service) Scale(scale int) error

func (*Service) Start

func (s *Service) Start() error

func (*Service) Up

func (s *Service) Up() error

type ServiceFactory

type ServiceFactory struct {
	// contains filtered or unexported fields
}

func (*ServiceFactory) Create

func (s *ServiceFactory) Create(project *project.Project, name string, serviceConfig *project.ServiceConfig) (project.Service, error)

Jump to

Keyboard shortcuts

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