Documentation ¶
Overview ¶
Package scribe contains a simplified version of Scribe, where no topic based ACLs are defined.
Index ¶
- Variables
- type Callback
- type Overlay
- func (o *Overlay) Balance(topic string, msg *proto.Message) error
- func (o *Overlay) Beat()
- func (o *Overlay) Boot() (int, error)
- func (o *Overlay) Dead(id *big.Int)
- func (o *Overlay) Deliver(msg *proto.Message, key *big.Int)
- func (o *Overlay) Direct(dest *big.Int, msg *proto.Message) error
- func (o *Overlay) Forward(msg *proto.Message, key *big.Int) bool
- func (o *Overlay) Publish(topic string, msg *proto.Message) error
- func (o *Overlay) Shutdown() error
- func (o *Overlay) Subscribe(topic string) error
- func (o *Overlay) Unsubscribe(topic string) error
Constants ¶
This section is empty.
Variables ¶
var ErrSubscribed = errors.New("already subscribed")
Custom topic error messages
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback interface { HandlePublish(sender *big.Int, topic string, msg *proto.Message) HandleBalance(sender *big.Int, topic string, msg *proto.Message) HandleDirect(sender *big.Int, msg *proto.Message) }
Callback for events leaving the overlay network.
type Overlay ¶
type Overlay struct {
// contains filtered or unexported fields
}
The overlay implementation, receiving the overlay events and processing them according to the protocol.
func New ¶
func New(overId string, key *rsa.PrivateKey, app Callback) *Overlay
Creates a new scribe overlay.
func (*Overlay) Beat ¶
func (o *Overlay) Beat()
Implements the heart.Callback.Beat method. At each heartbeat, the load stats of all the topics are gathered, mapped to destination nodes and sent out. In addition, each root topic sends a subscription message to discover newly added roots.
func (*Overlay) Dead ¶
Implements the heat.Callback.Dead method, monitoring the death events of topic member nodes.
func (*Overlay) Unsubscribe ¶
Removes the subscription from topic.