Documentation ¶
Overview ¶
Package observing contains plumbing for the tester's implementation of the observer pattern.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotSlice occurs when CheckObservers is passed something other than a slice. ErrNotSlice = errors.New("not an observer slice") // ErrObserverNil occurs when CheckObservers is passed a nil observer. ErrObserverNil = errors.New("observer nil") )
Functions ¶
func CheckObservers ¶
func CheckObservers(obs interface{}) error
CheckObservers does some cursory checking of the observer slice obs (currently just nil checking).
Types ¶
type Batch ¶
type Batch struct { // Kind is the kind of batch message being shown. Kind BatchKind `json:"kind"` // Num contains, in a start message, the number of items to expect in the batch. // In a step message, if set, it identifies the index of the item. Num int `json:"num"` }
Batch is a mixin struct for observer messages that represent 'batch runs'.
func NewBatchStart ¶
NewBatchStart makes a batch start mixin with total count n.
func NewBatchStep ¶
NewBatchStep makes a batch step mixin with current index i.
type FanIn ¶
type FanIn struct {
// contains filtered or unexported fields
}
FanIn is a low-level, reflection-based device for forwarding observations from multiple concurrent sources to a single handler.
Click to show internal directories.
Click to hide internal directories.