func (m Meta) Hooks() map[string]bool {
	allHooks := make(map[string]bool)
	// Unit hooks
	for _, hookName := range hooks.UnitHooks() {
		allHooks[string(hookName)] = true
	}
	// Relation hooks
	for hookName := range m.Provides {
		generateRelationHooks(hookName, allHooks)
	}
	for hookName := range m.Requires {
		generateRelationHooks(hookName, allHooks)
	}
	for hookName := range m.Peers {
		generateRelationHooks(hookName, allHooks)
	}
	for storageName := range m.Storage {
		generateStorageHooks(storageName, allHooks)
	}
	for containerName := range m.Containers {
		generateContainerHooks(containerName, allHooks)
	}
	return allHooks
}
// Hooks returns a map of all possible valid hooks, taking relations
// into account. It's a map to enable fast lookups, and the value is
// always true.
Hooks returns a map of all possible valid hooks, taking relations
into account. It's a map to enable fast lookups, and the value is
always true.
// Hooks returns a map of all possible valid hooks taking relations // into account . It ' s a map to enable fast lookups and the value is // always true .
func (m Meta) Hooks() map[string]bool {
	allHooks := make(map[string]bool)
	for _, hookName := range hooks.UnitHooks() {
		allHooks[string(hookName)] = true
	}
	for hookName := range m.Provides {
		generateRelationHooks(hookName, allHooks)
	}
	for hookName := range m.Requires {
		generateRelationHooks(hookName, allHooks)
	}
	for hookName := range m.Peers {
		generateRelationHooks(hookName, allHooks)
	}
	for storageName := range m.Storage {
		generateStorageHooks(storageName, allHooks)
	}
	for containerName := range m.Containers {
		generateContainerHooks(containerName, allHooks)
	}
	return allHooks
}
func ( m Meta ) Hooks ( ) map [ string ] bool { allHooks := make ( map [ string ] bool ) for _ , hookName := range hooks . UnitHooks ( ) { allHooks [ string ( hookName ) ] = true } for hookName := range m . Provides { generateRelationHooks ( hookName , allHooks ) } for hookName := range m . Requires { generateRelationHooks ( hookName , allHooks ) } for hookName := range m . Peers { generateRelationHooks ( hookName , allHooks ) } for storageName := range m . Storage { generateStorageHooks ( storageName , allHooks ) } for containerName := range m . Containers { generateContainerHooks ( containerName , allHooks ) } return allHooks }
Hooks returns a map of all possible valid hooks, taking relations
into account.
Hooks returns a map of all possible valid hooks taking relations into account .
// Unit hooks // Relation hooks