swarm

package
v0.0.0-...-8cfe922 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2016 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package swarm provides general business logic of handling swarms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveInstanceFromDiscovery

func RemoveInstanceFromDiscovery(i swarmtypes.Instance) error

RemoveInstanceFromDiscovery removes an instance from etcd discovery.

Types

type Config

type Config struct {
}

Config describes the configuration of a Service.

type Dependencies

type Dependencies struct {
}

Dependencies describe the dependencies of a Service.

type ProviderManager

type ProviderManager struct {
	Providers []ProviderType
	// contains filtered or unexported fields
}

ProviderManager describes available and active Providers.

func NewManager

func NewManager() ProviderManager

NewManager returns a new ProviderManager.

func (ProviderManager) ActiveProviders

func (pm ProviderManager) ActiveProviders() ([]provider.Provider, error)

ActiveProviders returns all active Providers.

func (ProviderManager) GetByType

func (pm ProviderManager) GetByType(providerType ProviderType) (provider.Provider, error)

GetByType returns a Provider, given a ProviderType.

type ProviderType

type ProviderType int

ProviderType describes the type of Provider.

const (
	AWS ProviderType = iota
	OpenStack
	Conair
)

Iota describing the available Providers.

type Service

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

Service descibes a ProviderManager, and some configuration and dependencies.

func NewService

func NewService(cfg Config, deps Dependencies) *Service

NewService returns a new Service.

func (*Service) Create

func (srv *Service) Create(name string, providerType ProviderType, flags swarmtypes.CreateFlags) (*Swarm, error)

Create creates and returns a Swarm, given a name for the swarm, a ProviderType, and CreateFlags.

func (*Service) Get

func (srv *Service) Get(name string, providerType ProviderType) (*Swarm, error)

Get returns a Swarm, given a swarm name, and a ProviderType.

func (*Service) List

func (srv *Service) List() ([]*Swarm, error)

List returns all available Swarms.

type Swarm

type Swarm struct {
	Name    string
	Type    string
	Created time.Time
	// contains filtered or unexported fields
}

Swarm represents a cluster of CoreOS machines.

func (*Swarm) Destroy

func (s *Swarm) Destroy() error

Destroy destroys the Swarm.

func (*Swarm) GetInstances

func (s *Swarm) GetInstances() ([]swarmtypes.Instance, error)

GetInstances returns all the instances of the Swarm.

func (*Swarm) GetPrivateDNS

func (s *Swarm) GetPrivateDNS() (string, error)

GetPrivateDNS returns the private DNS address of the Swarm.

func (*Swarm) GetPublicDNS

func (s *Swarm) GetPublicDNS() (string, error)

GetPublicDNS returns the public DNS address of the Swarm.

func (*Swarm) GetStatus

func (s *Swarm) GetStatus() (string, string, error)

GetStatus returns the status, and a possibly empty status reason, of the Swarm.

func (*Swarm) KillInstance

func (s *Swarm) KillInstance(i swarmtypes.Instance) error

KillInstance kills a given instance of the Swarm.

func (*Swarm) WaitUntil

func (s *Swarm) WaitUntil(status string) error

WaitUntil waits till the Swarm reaches a given status.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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