hooks

package
v0.0.0-...-ce71dfa Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2012 License: BSD-2-Clause-Views Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	*Hooks
	Hookname string
}

func (*Hook) Fire

func (e *Hook) Fire(params ...interface{})

Fire calls hooks subscribed to Hookname, but does not case about their return values.

func (*Hook) HasSubscribers

func (e *Hook) HasSubscribers() bool

func (*Hook) Iterate

func (e *Hook) Iterate(stopfunc interface{}, params ...interface{})

Calls all hooks subscribed to Hookname, with params, feeding the output of every hook into stopfunc. Stopfunc's argument signature must match the signatures of return values of the called hooks. Stopfunc must return a boolean value. A boolean value of true stops the iteration. Iterate allows to mimic the semantics of calling all hooks one by one.

func (*Hook) SubscriberCount

func (e *Hook) SubscriberCount() int

func (*Hook) Subscribers

func (e *Hook) Subscribers() []iface.Subscriber

type Hooks

type Hooks struct {
	// contains filtered or unexported fields
}

Used to call subscribed hooks.

func New

func New(hooks map[string]interface{}, newModule func(string) iface.Module) *Hooks

func (*Hooks) Initer

func (e *Hooks) Initer(initer func(iface.Instance) error)

func (*Hooks) Module

func (e *Hooks) Module(modname string) iface.Module

func (*Hooks) Select

func (e *Hooks) Select(Hookname string) iface.Hook

type InstanceCacher

type InstanceCacher struct {
	iface.Module
	// contains filtered or unexported fields
}

This is an iface.Module, which wraps the github.com/opesun/nocrud/frame/mod implementation and implements instance caching.

func (InstanceCacher) Instance

func (m InstanceCacher) Instance() iface.Instance

Jump to

Keyboard shortcuts

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