Documentation ¶
Overview ¶
Package juju provide utilities functions for interaction with Juju. It also provides a provisioner implementation for Juju.
In order to use the provisioner, just import tsuru's provision package and juju provision package. Then call provision.Get("juju") to get an instance of JujuProvisioner:
import ( "github.com/globocom/tsuru/provision" _ "github.com/globocom/tsuru/provision/juju" ) // ... func main() { provisioner, err := provision.Get("juju") // Use provisioner. }
Index ¶
- type ELBManager
- func (m *ELBManager) Addr(app provision.Named) (string, error)
- func (m *ELBManager) Create(app provision.Named) error
- func (m *ELBManager) Deregister(app provision.Named, units ...provision.Unit) error
- func (m *ELBManager) Destroy(app provision.Named) error
- func (m *ELBManager) Register(app provision.Named, units ...provision.Unit) error
- type JujuProvisioner
- func (p *JujuProvisioner) AddUnits(app provision.App, n uint) ([]provision.Unit, error)
- func (p *JujuProvisioner) Addr(app provision.App) (string, error)
- func (p *JujuProvisioner) CollectStatus() ([]provision.Unit, error)
- func (p *JujuProvisioner) Destroy(app provision.App) error
- func (p *JujuProvisioner) ExecuteCommand(stdout, stderr io.Writer, app provision.App, cmd string, args ...string) error
- func (p *JujuProvisioner) LoadBalancer() *ELBManager
- func (p *JujuProvisioner) Provision(app provision.App) error
- func (p *JujuProvisioner) RemoveUnit(app provision.App, name string) error
- func (p *JujuProvisioner) Restart(app provision.App) error
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ELBManager ¶
type ELBManager struct {
// contains filtered or unexported fields
}
ELBManager manages load balancers within Amazon Elastic Load Balancer.
If juju:use-elb is true on tsuru.conf, this manager will be used for managing load balancers on tsuru.
It uses db package and adds a new collection to tsuru's DB. The name of the collection is also defined in the configuration file (juju:elb-collection).
func (*ELBManager) Addr ¶
func (m *ELBManager) Addr(app provision.Named) (string, error)
Addr returns the dns-name of a load balancer, which is also the DNS name of the app.
func (*ELBManager) Create ¶
func (m *ELBManager) Create(app provision.Named) error
Create creates a new Elastic Load Balancing instance for the given app. The name of the instance will be the same as the name of the app.
func (*ELBManager) Deregister ¶
Deregister removes EC2 instances (represented as units) from a load balancer.
type JujuProvisioner ¶
type JujuProvisioner struct {
// contains filtered or unexported fields
}
JujuProvisioner is an implementation for the Provisioner interface. For more details on how a provisioner work, check the documentation of the provision package.
func (*JujuProvisioner) CollectStatus ¶
func (p *JujuProvisioner) CollectStatus() ([]provision.Unit, error)
func (*JujuProvisioner) ExecuteCommand ¶
func (*JujuProvisioner) LoadBalancer ¶
func (p *JujuProvisioner) LoadBalancer() *ELBManager
func (*JujuProvisioner) RemoveUnit ¶
func (p *JujuProvisioner) RemoveUnit(app provision.App, name string) error