Documentation ¶
Index ¶
- func BuildSimpleTable(bvns []string) []protocol.Route
- func RouteEnvelopes(routeAccount func(*url.URL) (string, error), envs ...*messaging.Envelope) (string, error)
- func RouteMessages(r Router, messages []messaging.Message) (string, error)
- type MessageRouter
- type RouteTree
- type Router
- type RouterInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildSimpleTable ¶
func RouteEnvelopes ¶
func RouteEnvelopes(routeAccount func(*url.URL) (string, error), envs ...*messaging.Envelope) (string, error)
RouteEnvelopes routes envelopes based on the routing location of their signatures. RouteEnvelopes will return an error if the envelopes do not contain any signatures. RouteEnvelopes will return an error if the message bundle has signatures with conflicting routing locations.
func RouteMessages ¶
RouteMessages routes the message bundle based on the routing location of its signatures. RouteMessages will return an error if the message bundle does not contain any signatures. RouteMessages will return an error if the message bundle has signatures with conflicting routing locations.
Types ¶
type MessageRouter ¶
type MessageRouter struct {
Router Router
}
MessageRouter routes messages using a Router.
type RouteTree ¶
type RouteTree struct {
// contains filtered or unexported fields
}
func NewRouteTree ¶
func NewRouteTree(table *protocol.RoutingTable) (*RouteTree, error)
type Router ¶
type Router interface { RouteAccount(*url.URL) (string, error) Route(...*messaging.Envelope) (string, error) }
Router defines a basic interface for routing and sending transactions.
TODO Route and Send should probably be handled separately.
type RouterInstance ¶
type RouterInstance struct {
// contains filtered or unexported fields
}
RouterInstance sends transactions to remote nodes via RPC calls.
func NewStaticRouter ¶
func NewStaticRouter(table *protocol.RoutingTable, logger log.Logger) (*RouterInstance, error)
NewStaticRouter returns a router that uses a static routing table
func (*RouterInstance) Route ¶
func (r *RouterInstance) Route(envs ...*messaging.Envelope) (string, error)
Route routes the account using modulo routing.
func (*RouterInstance) RouteAccount ¶
func (r *RouterInstance) RouteAccount(account *url.URL) (string, error)