Documentation ¶
Index ¶
- type ExchangeProtocol
- func (self *ExchangeProtocol) Interested(peer string, subject string) bool
- func (self *ExchangeProtocol) Ping(peer string) (*pb.PingReply, error)
- func (self *ExchangeProtocol) PingAll() (map[string]*pb.PingReply, error)
- func (self *ExchangeProtocol) Propagate(report *pb.Report) error
- func (self *ExchangeProtocol) PropagateAll(request *pb.LearnReportRequest) error
- func (self *ExchangeProtocol) PropagatePeer(peer string, addr string, ignoreset *IgnoreSet, request *pb.LearnReportRequest) (bool, error, time.Duration)
- func (self *ExchangeProtocol) Subscribe(subject string) error
- func (self *ExchangeProtocol) Uninterested(peer string, subject string) bool
- func (self *ExchangeProtocol) Unsubscribe(subject string) error
- type IgnoreSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExchangeProtocol ¶
type ExchangeProtocol struct { Id string // my id Addr string // my addr Peers map[string]string // all peers' id and address SkipSubjectPeers map[string]*IgnoreSet // skip sending reports about a subject to certain peers Clients map[string]pb.HealthServiceClient // clients to all peers // contains filtered or unexported fields }
func NewExchangeProtocol ¶
func NewExchangeProtocol(config *dt.HealthServerConfig) *ExchangeProtocol
func (*ExchangeProtocol) Interested ¶
func (self *ExchangeProtocol) Interested(peer string, subject string) bool
func (*ExchangeProtocol) Ping ¶
func (self *ExchangeProtocol) Ping(peer string) (*pb.PingReply, error)
func (*ExchangeProtocol) PingAll ¶
func (self *ExchangeProtocol) PingAll() (map[string]*pb.PingReply, error)
func (*ExchangeProtocol) Propagate ¶
func (self *ExchangeProtocol) Propagate(report *pb.Report) error
func (*ExchangeProtocol) PropagateAll ¶
func (self *ExchangeProtocol) PropagateAll(request *pb.LearnReportRequest) error
func (*ExchangeProtocol) PropagatePeer ¶
func (self *ExchangeProtocol) PropagatePeer(peer string, addr string, ignoreset *IgnoreSet, request *pb.LearnReportRequest) (bool, error, time.Duration)
Propagate something to a peer. This something could be a normal report or a subscription/unsubscription request. In the former case, we should check if the receiver peer is interested in knowing the report. If not, we should stop propagating the report to the receiver in the future until it becomes interested in the report again.
func (*ExchangeProtocol) Subscribe ¶
func (self *ExchangeProtocol) Subscribe(subject string) error
func (*ExchangeProtocol) Uninterested ¶
func (self *ExchangeProtocol) Uninterested(peer string, subject string) bool
func (*ExchangeProtocol) Unsubscribe ¶
func (self *ExchangeProtocol) Unsubscribe(subject string) error
type IgnoreSet ¶
type IgnoreSet struct {
// contains filtered or unexported fields
}
func NewIgnoreSet ¶
func NewIgnoreSet() *IgnoreSet
Click to show internal directories.
Click to hide internal directories.