Documentation ¶
Index ¶
- Variables
- type Artifact
- type Config
- type ConsulEventHook
- type ConsulLocker
- type FileInstaller
- type GraphiteEventHook
- type Hook
- type HookConfig
- type HookDefinition
- type Installer
- type Locker
- type MetaData
- type RackspaceUpdater
- type S3Updater
- type ScriptHook
- type ServiceFile
- type TarInstaller
- type TemplateData
- type Updater
Constants ¶
This section is empty.
Variables ¶
var ErrNilReader = errors.New("Install: must have a non-nil Reader")
ErrNilReader is a generic error for when the reader is nil
var (
ErrUnableToConnect = errors.New("RackspaceUpdater: unable to connect to rackspace.")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `hcl:",key"` CheckInterval string `hcl:"checkInterval"` UpdateTTL string `hcl:"updateTTL"` PostCommand string `hcl:"postCommand"` PreCommand string `hcl:"preCommand"` BeforeHooks []HookDefinition `hcl:"before"` AfterHooks []HookDefinition `hcl:"after"` Sequential bool `hcl:"sequentialUpdates"` RawArtifact map[string]Artifact `hcl:"artifact,expand"` Artifact Artifact `hcl:"-"` Hash string `hcl:"hash"` Updater Updater `hcl:"-"` Locker Locker `hcl:"-"` }
func LoadServices ¶
type ConsulEventHook ¶
type ConsulEventHook struct {
// contains filtered or unexported fields
}
func NewConsulEventHook ¶
func NewConsulEventHook(cfg map[string]string) ConsulEventHook
func (ConsulEventHook) Execute ¶
func (h ConsulEventHook) Execute(config HookConfig, service Config) error
type ConsulLocker ¶
type ConsulLocker struct {
// contains filtered or unexported fields
}
ConsulLocker is a Locker that will use consul as the coordinator for establish a lock amongst multiple machines
func NewConsulLocker ¶
func NewConsulLocker(cfg map[string]string) (*ConsulLocker, error)
func (ConsulLocker) Acquire ¶
func (l ConsulLocker) Acquire(shutdownCh <-chan struct{}) (<-chan struct{}, error)
func (ConsulLocker) Release ¶
func (l ConsulLocker) Release() error
type FileInstaller ¶
type FileInstaller struct{}
FileInstaller defines an Installer that takes the reader and writes it to the dest directory.
type GraphiteEventHook ¶
type GraphiteEventHook struct{}
func (GraphiteEventHook) Execute ¶
func (h GraphiteEventHook) Execute(config HookConfig, service Config) error
type Hook ¶
type Hook interface {
Execute(config HookConfig, service Config) error
}
Hook is an interface that defines a method for executing custom behavior at certain hook points
func GetHookByName ¶
GetHookByName returns a hook by the id name given.
TODO(ChrisMcKenzie): this is kind of ugly and could probably be cleaned through the use of hooks being packages and registering with a hook manager
type HookConfig ¶
type HookDefinition ¶
type HookDefinition map[string]HookConfig
type Installer ¶
Installer is an interface that allows different methods of writing the given io.Reader to disk.
type Locker ¶
type Locker interface { // Acquire takes a shutdownCh and return a lock chan and error // // the lock chan can be used to block the process until the lock // has been acquired and the chan receives. Acquire(<-chan struct{}) (<-chan struct{}, error) // Release will release the lock allowing for other processes to // acquire. Release() error }
Locker is an interface that allows you to block execution of another process across a set of machines.
type RackspaceUpdater ¶
type RackspaceUpdater struct {
// contains filtered or unexported fields
}
func NewRackspaceUpdater ¶
func NewRackspaceUpdater(config map[string]string) *RackspaceUpdater
func (*RackspaceUpdater) Download ¶
func (u *RackspaceUpdater) Download(opt Artifact) (io.ReadCloser, MetaData, error)
func (*RackspaceUpdater) IsOutdated ¶
func (u *RackspaceUpdater) IsOutdated(hash string, opts Artifact) (bool, error)
type S3Updater ¶
type S3Updater struct {
// contains filtered or unexported fields
}
S3Updater is an Updater for updating file that come from amazone s3
func NewS3Updater ¶
NewS3Updater will return a configured Updater for check against amazon s3
type ScriptHook ¶
type ScriptHook struct{}
ScriptHook defines a Hook that will run a specified command on a the machine.
func (ScriptHook) Execute ¶
func (h ScriptHook) Execute(config HookConfig, service Config) error
Execute is a Hook method to execut the hook with standard options
type ServiceFile ¶
type ServiceFile struct {
Services []Config `hcl:"service,expand"`
}
type TarInstaller ¶
type TarInstaller struct{}
TarInstaller Defines an install Method that takes a destination path and a io.Reader and untars and gzip decodes a tarball and places the files inside on the FS with `dest` as their root It returns the number of files written and an error
type TemplateData ¶
TemplateData specifies some system configurations that can be used in hook options using go template syntax