hooks

package
v3.0.0-...-ceed5c3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2014 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

hooks provides types and constants that define the hooks known to Juju.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kind

type Kind string

Kind enumerates the different kinds of hooks that exist.

const (
	// None of these hooks are ever associated with a relation; each of them
	// represents a change to the state of the unit as a whole. The values
	// themselves are all valid hook names.
	Install         Kind = "install"
	Start           Kind = "start"
	ConfigChanged   Kind = "config-changed"
	UpgradeCharm    Kind = "upgrade-charm"
	Stop            Kind = "stop"
	ActionRequested Kind = "action-requested"
	CollectMetrics  Kind = "collect-metrics"

	// These hooks require an associated relation, and the name of the relation
	// unit whose change triggered the hook. The hook file names that these
	// kinds represent will be prefixed by the relation name; for example,
	// "db-relation-joined".
	RelationJoined   Kind = "relation-joined"
	RelationChanged  Kind = "relation-changed"
	RelationDeparted Kind = "relation-departed"

	// This hook requires an associated relation. The represented hook file name
	// will be prefixed by the relation name, just like the other Relation* Kind
	// values.
	RelationBroken Kind = "relation-broken"
)

func RelationHooks

func RelationHooks() []Kind

RelationHooks returns all known relation hook kinds.

func UnitHooks

func UnitHooks() []Kind

UnitHooks returns all known unit hook kinds.

func (Kind) IsRelation

func (kind Kind) IsRelation() bool

IsRelation returns whether the Kind represents a relation hook.

Jump to

Keyboard shortcuts

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