Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActionInterface ¶
type ActionInterface interface{}
type AppInterface ¶
type AppInterface interface { WatcherInterface DispatcherInterface }
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func NewDispatcher(notifier NotifierInterface, stores ...StoreInterface) *Dispatcher
NewDispatcher creates a new dispatcher and registers the provided stores
func (*Dispatcher) Dispatch ¶
func (d *Dispatcher) Dispatch(action ActionInterface) chan struct{}
Dispatch sends an action to all registered stores
func (*Dispatcher) Register ¶
func (d *Dispatcher) Register(store StoreInterface)
Register adds a store to the dispatcher
type DispatcherInterface ¶
type DispatcherInterface interface {
Dispatch(action ActionInterface) chan struct{}
}
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
func NewNotifier ¶
func NewNotifier() *Notifier
type NotifierInterface ¶
type NotifierInterface interface { // Notify sends the notif notification to all subscribers of that // notification for object. If object is nil, the notification is sent to // all subscribers. The chanel returned is closed when the notify action // has finished. Notify() (done chan struct{}) }
type Payload ¶
type Payload struct { Action ActionInterface Done chan struct{} // contains filtered or unexported fields }
func (*Payload) Wait ¶
func (p *Payload) Wait(stores ...StoreInterface)
Wait is used by the store handler to wait for other stores to finish.
type StoreInterface ¶
type WatcherInterface ¶
type WatcherInterface interface { Watch(key interface{}, f func(done chan struct{})) Delete(key interface{}) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.