Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Accept indicates that the message should be processed Accept = iota // Reject indicates that the message should not be processed Reject // Forward indicates that the rule could not determine the correct course of action Forward )
Variables ¶
View Source
var AcceptRule = Rule(acceptRule{})
AcceptRule always returns Accept as a result for Apply
View Source
var EmptyRejectRule = Rule(emptyRejectRule{})
EmptyRejectRule rejects empty messages
View Source
var NoopCommitter = Committer(noopCommitter{})
NoopCommitter does nothing on commit and is not isolated
Functions ¶
This section is empty.
Types ¶
type Committer ¶
type Committer interface { // Commit performs whatever action should be performed upon commiting of a message Commit() // Isolated returns whether this transaction should have a block to itself or may be mixed with other transactions Isolated() bool }
Committer is returned by postfiltering and should be invoked once the message has been written to the blockchain
type Rule ¶
type Rule interface { // Apply applies the rule to the given Envelope, replying with the Action to take for the message // If the filter Accepts a message, it should provide a committer to use when writing the message to the chain Apply(message *ab.Envelope) (Action, Committer) }
Rule defines a filter function which accepts, rejects, or forwards (to the next rule) an Envelope
Click to show internal directories.
Click to hide internal directories.