Documentation ¶
Overview ¶
Package signaller sends notifications to running PullDeploy daemons.
The signaller is intended to use Zookeeper for synchronization. If Zookeeper is not available, a timer is used as a fallback to drive polling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notification ¶
type Notification struct { Source NotifySource // The mechanism that caused the event Appname string // The name of the application that caused the event Data []byte // Optional data associated with the event }
A Notification identifies which monitored application has changed. They are obtained from the channel returned by Open().
type NotifySource ¶
type NotifySource int
NotifySource indicates what mechanism triggered the event.
const ( KNS_FORCED NotifySource = iota // Notification was created externally to signaller KNS_TIMER // Notification was triggered by a timer KNS_ZK // Notification was triggered by Zookeeper )
The values that may appear as the Source in a Notification.
func (NotifySource) String ¶
func (ns NotifySource) String() string
String provides a printable representation of a NotifySource.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a registry of all hosts running Pulldeploy, with the environments and applications they are tracking.
NOTE: The Registry stores its data in Zookeeper ephemeral nodes, so this feature is available only when PullDeploy has access to a Zookeeper installation.
func (*Registry) Hosts ¶
func (hr *Registry) Hosts(envName, appName string) []RegistryInfo
Hosts retrieves the information in the hosts registry for the given environment and application (requires Zookeeper).
func (*Registry) Register ¶
Register enters the name of the local machine into the hosts registry, along with the currently released version and available deployments (requires Zookeeper).
func (*Registry) Unregister ¶
Unregister removes the name of the local machine from the hosts registry (requires Zookeeper).
type RegistryInfo ¶
type RegistryInfo struct { Hostname string // The name of the server running the application Envname string // The name of the environment this host is tracking Appname string // The name of the application this host is running AppVersion string // The version of the application this host is serving Deployed []string // The versions currently available on this host }
RegistryInfo is used to present the information in the Registry.
type Signaller ¶
type Signaller struct {
// contains filtered or unexported fields
}
Signaller is used to notify running daemons of deploy and release activity.
func New ¶
func New(cfg *pdconfig.SignallerConfig, lw *logging.Writer) *Signaller
New returns a new Signaller.
func (*Signaller) Close ¶
func (sgnlr *Signaller) Close()
Close deallocates the resources allocated by Open.
func (*Signaller) GetRegistry ¶
GetRegistry retrieves an instance of the hosts registry.
func (*Signaller) Monitor ¶
Monitor is used to ask for notifications for the given environment and application.
func (*Signaller) Notify ¶
Notify sends a notication to all listening daemons in the specified environment.
func (*Signaller) Open ¶
func (sgnlr *Signaller) Open() <-chan Notification
Open allocates the resources needed for sending and receiving notifications.