Documentation ¶
Overview ¶
Package match builds a tree of active subscriptions that is matched against all incoming updates.
Index ¶
Constants ¶
const Glob = "*"
Glob is a special string used to indicate a match of any path node.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Update(interface{})
}
Client is a interface for a callback invoked for all matching updates.
type Match ¶
type Match struct {
// contains filtered or unexported fields
}
Match is a structure that will invoke registered query callbacks for each matching update.
func (*Match) AddQuery ¶
AddQuery registers a client callback for all matching nodes. It returns a callback to remove the query. The remove function is idempotent.
func (*Match) Update ¶
Update invokes all client callbacks for queries that match the supplied node.
func (*Match) UpdateOnce ¶
UpdateOnce invokes the callback of each client whose query matches the supplied node and if the client hasn't been updated (in which case it is not in the updated). If the callback of a client has been invoked in this call, the client will be added to updated if updated is not nil. Therefore, in order to track updated clients, updated must not be nil.