broker

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2016 License: GPL-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationExistError

type ApplicationExistError struct {
	Name, Namespace string
}

func (ApplicationExistError) Error

func (e ApplicationExistError) Error() string

func (ApplicationExistError) HTTPErrorStatusCode

func (e ApplicationExistError) HTTPErrorStatusCode() int

type ApplicationNotFoundError

type ApplicationNotFoundError string

func (ApplicationNotFoundError) Error

func (e ApplicationNotFoundError) Error() string

func (ApplicationNotFoundError) HTTPErrorStatusCode

func (e ApplicationNotFoundError) HTTPErrorStatusCode() int

type Broker

type Broker struct {
	container.DockerClient
	Users *userdb.UserDatabase
	Authz *auth.Authenticator
	SCM   scm.SCM
	Hub   *hub.PluginHub
}

Broker maintains all external services.

func New

func New(cli container.DockerClient) (broker *Broker, err error)

func (*Broker) CreateUser

func (br *Broker) CreateUser(user userdb.User, password string) (err error)

func (*Broker) GetUser

func (br *Broker) GetUser(username string) (userdb.User, error)

func (*Broker) NewUserBroker

func (br *Broker) NewUserBroker(user userdb.User, ctx context.Context) *UserBroker

func (*Broker) RemoveUser

func (br *Broker) RemoveUser(username string) (err error)

func (*Broker) StartContainers

func (br *Broker) StartContainers(ctx context.Context, containers []*container.Container) error

type NamespaceNotEmptyError

type NamespaceNotEmptyError string

func (NamespaceNotEmptyError) Error

func (e NamespaceNotEmptyError) Error() string

func (NamespaceNotEmptyError) HTTPErrorStatusCode

func (e NamespaceNotEmptyError) HTTPErrorStatusCode() int

type NoNamespaceError

type NoNamespaceError string

func (NoNamespaceError) Error

func (e NoNamespaceError) Error() string

func (NoNamespaceError) HTTPErrorStatusCode

func (e NoNamespaceError) HTTPErrorStatusCode() int

type ScalingError

type ScalingError int

func (ScalingError) Error

func (e ScalingError) Error() string

func (ScalingError) HTTPErrorStatusCode

func (e ScalingError) HTTPErrorStatusCode() int

type UserBroker

type UserBroker struct {
	*Broker
	User userdb.User
	// contains filtered or unexported fields
}

UserBroker performs user specific operations.

func (*UserBroker) AddHost

func (br *UserBroker) AddHost(name, host string) error

func (*UserBroker) CreateApplication

func (br *UserBroker) CreateApplication(opts container.CreateOptions, tags []string) (app *userdb.Application, containers []*container.Container, err error)

func (*UserBroker) CreateNamespace

func (br *UserBroker) CreateNamespace(namespace string) (err error)

func (*UserBroker) CreateServices

func (br *UserBroker) CreateServices(opts container.CreateOptions, tags []string) (containers []*container.Container, err error)

func (*UserBroker) Download

func (br *UserBroker) Download(name string) (io.ReadCloser, error)

Download application repository as a archive file.

func (*UserBroker) Dump

func (br *UserBroker) Dump(name string) (io.ReadCloser, error)

func (*UserBroker) GetApplications

func (br *UserBroker) GetApplications() (apps map[string]*userdb.Application, err error)

func (*UserBroker) GetInstalledPlugins

func (br *UserBroker) GetInstalledPlugins(category manifest.Category) (plugins []*manifest.Plugin)

GetInstalledPlugins returns all installed plugins, include user and system plugins.

func (*UserBroker) GetPluginInfo

func (br *UserBroker) GetPluginInfo(tag string) (plugin *manifest.Plugin, err error)

GetPluginInfo returns a installed plugin meta data.

func (*UserBroker) GetUserPlugins

func (br *UserBroker) GetUserPlugins(category manifest.Category) (plugins []*manifest.Plugin)

GetUserPlugins returns a list of user defined plugins.

func (*UserBroker) InstallPlugin

func (br *UserBroker) InstallPlugin(ar io.Reader) error

InstallPlugin installs a user defined plugin.

func (*UserBroker) Namespace

func (br *UserBroker) Namespace() string

func (*UserBroker) Refresh

func (br *UserBroker) Refresh() error

func (*UserBroker) RemoveApplication

func (br *UserBroker) RemoveApplication(name string) (err error)

func (*UserBroker) RemoveHost

func (br *UserBroker) RemoveHost(name, host string) error

func (*UserBroker) RemoveNamespace

func (br *UserBroker) RemoveNamespace(force bool) (err error)

func (*UserBroker) RemovePlugin

func (br *UserBroker) RemovePlugin(tag string) error

RemovePlugin removes a user defined plugin.

func (*UserBroker) RemoveService

func (br *UserBroker) RemoveService(name, service string) (err error)

func (*UserBroker) RestartApplication

func (br *UserBroker) RestartApplication(name string) error

func (*UserBroker) Restore

func (br *UserBroker) Restore(name string, source io.Reader) error

func (*UserBroker) ScaleApplication

func (br *UserBroker) ScaleApplication(name string, num int) ([]*container.Container, error)

Scale application by adding or removing containers in the application.

func (*UserBroker) StartApplication

func (br *UserBroker) StartApplication(name string) error

func (*UserBroker) StopApplication

func (br *UserBroker) StopApplication(name string) error

func (*UserBroker) Upload

func (br *UserBroker) Upload(name string, content io.Reader, binary bool, logger io.Writer) error

Upload application repository from a archive file.

Jump to

Keyboard shortcuts

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