Documentation ¶
Overview ¶
Package swarm provides general business logic of handling swarms.
Index ¶
- func RemoveInstanceFromDiscovery(i swarmtypes.Instance) error
- type Config
- type Dependencies
- type ProviderManager
- type ProviderType
- type Service
- type Swarm
- func (s *Swarm) Destroy() error
- func (s *Swarm) GetInstances() ([]swarmtypes.Instance, error)
- func (s *Swarm) GetPrivateDNS() (string, error)
- func (s *Swarm) GetPublicDNS() (string, error)
- func (s *Swarm) GetStatus() (string, string, error)
- func (s *Swarm) KillInstance(i swarmtypes.Instance) error
- func (s *Swarm) WaitUntil(status string) error
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 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 (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.
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) GetInstances ¶
GetInstances returns all the instances of the Swarm.
func (*Swarm) GetPrivateDNS ¶
GetPrivateDNS returns the private DNS address of the Swarm.
func (*Swarm) GetPublicDNS ¶
GetPublicDNS returns the public DNS address of the Swarm.
func (*Swarm) GetStatus ¶
GetStatus returns the status, and a possibly empty status reason, of the Swarm.
func (*Swarm) KillInstance ¶
KillInstance kills a given instance of the Swarm.