Documentation ¶
Index ¶
- func LessByNeighbourWeightForNodeAppearance(n1, n2 interface{}) bool
- func ShuffleNodeAppearances(shuffleFunc args.ShuffleFunc, nodeRefs []*NodeAppearance)
- type AtomicEventStats
- func (p *AtomicEventStats) GetDynamicCounts() (briefCount, fullCount uint16)
- func (p *AtomicEventStats) GetPurgatoryCounts() (addedCount, ascentCount uint16)
- func (p *AtomicEventStats) GetTrustCounts() (fraudCount, bySelfCount, bySomeCount, byNeighborsCount uint16)
- func (p *AtomicEventStats) OnCustomEvent(populationVersion uint32, n *NodeAppearance, event interface{})
- func (p *AtomicEventStats) OnDynamicNodeUpdate(populationVersion uint32, n *NodeAppearance, flags UpdateFlags)
- func (p *AtomicEventStats) OnDynamicPopulationCompleted(populationVersion uint32, indexedCount int)
- func (p *AtomicEventStats) OnNodeStateAssigned(populationVersion uint32, n *NodeAppearance)
- func (p *AtomicEventStats) OnPurgatoryNodeUpdate(populationVersion uint32, n MemberPacketSender, flags UpdateFlags)
- func (p *AtomicEventStats) OnTrustUpdated(populationVersion uint32, n *NodeAppearance, trustBefore member.TrustLevel, ...)
- type DispatchFactoryFunc
- type DispatchMemberPacketFunc
- type DynamicRealmPopulation
- func (p *DynamicRealmPopulation) AddReservation(id node.ShortNodeID) (bool, *NodeAppearance)
- func (p *DynamicRealmPopulation) AddToDynamics(ctx context.Context, na *NodeAppearance) (*NodeAppearance, error)
- func (p *DynamicRealmPopulation) CreatePacketLimiter(isJoiner bool) phases.PacketLimiter
- func (p *DynamicRealmPopulation) CreateVectorHelper() *RealmVectorHelper
- func (p *DynamicRealmPopulation) FindReservation(id node.ShortNodeID) (bool, *NodeAppearance)
- func (p *DynamicRealmPopulation) GetActiveNodeAppearance(id node.ShortNodeID) *NodeAppearance
- func (p *DynamicRealmPopulation) GetAnyNodes(includeIndexed bool, shuffle bool) []*NodeAppearance
- func (p *DynamicRealmPopulation) GetDynamicCounts() (briefCount, fullCount uint16)
- func (p *DynamicRealmPopulation) GetHook() *Hook
- func (p *DynamicRealmPopulation) GetIndexedCount() int
- func (p *DynamicRealmPopulation) GetIndexedCountAndCompleteness() (int, bool)
- func (p *DynamicRealmPopulation) GetIndexedNodes() []*NodeAppearance
- func (p *DynamicRealmPopulation) GetIndexedNodesAndHasNil() ([]*NodeAppearance, bool)
- func (p *DynamicRealmPopulation) GetJoinerNodeAppearance(id node.ShortNodeID) *NodeAppearance
- func (p *DynamicRealmPopulation) GetJoinersCount() int
- func (p *DynamicRealmPopulation) GetNodeAppearance(id node.ShortNodeID) *NodeAppearance
- func (p *DynamicRealmPopulation) GetNodeAppearanceByIndex(idx int) *NodeAppearance
- func (p *DynamicRealmPopulation) GetPurgatoryCounts() (addedCount, ascentCount uint16)
- func (p *DynamicRealmPopulation) GetSealedCapacity() (int, bool)
- func (p *DynamicRealmPopulation) GetSelf() *NodeAppearance
- func (p *DynamicRealmPopulation) GetShuffledOtherNodes() []*NodeAppearance
- func (p *DynamicRealmPopulation) GetTrustCounts() (fraudCount, bySelfCount, bySomeCount, byNeighborsCount uint16)
- func (p *DynamicRealmPopulation) InitCallback(callback EventDispatcher)
- func (p *DynamicRealmPopulation) NotifyAllOnAdded()
- func (p *DynamicRealmPopulation) SealIndexed(indexedCountLimit int) bool
- type EventClosureFunc
- type EventDispatchFunc
- type EventDispatcher
- func NewIgnoringDispatcher() EventDispatcher
- func NewInterceptor(intercept EventDispatcher) EventDispatcher
- func NewInterceptorAndSink(intercept EventDispatcher, sink EventDispatchFunc) EventDispatcher
- func NewPanicDispatcher(panicMsg string) EventDispatcher
- func NewSinkDispatcher(sink EventDispatchFunc) EventDispatcher
- type EventWrapper
- func (p *EventWrapper) OnCustomEvent(populationVersion uint32, n *NodeAppearance, event interface{})
- func (p *EventWrapper) OnDynamicNodeUpdate(populationVersion uint32, n *NodeAppearance, flags UpdateFlags)
- func (p *EventWrapper) OnDynamicPopulationCompleted(populationVersion uint32, indexedCount int)
- func (p *EventWrapper) OnNodeStateAssigned(populationVersion uint32, n *NodeAppearance)
- func (p *EventWrapper) OnPurgatoryNodeUpdate(populationVersion uint32, n MemberPacketSender, flags UpdateFlags)
- func (p *EventWrapper) OnTrustUpdated(populationVersion uint32, n *NodeAppearance, before member.TrustLevel, ...)
- type FixedRealmPopulation
- func (r *FixedRealmPopulation) AddToDynamics(ctx context.Context, n *NodeAppearance) (*NodeAppearance, error)
- func (r *FixedRealmPopulation) CreateVectorHelper() *RealmVectorHelper
- func (r *FixedRealmPopulation) GetActiveNodeAppearance(id node.ShortNodeID) *NodeAppearance
- func (r *FixedRealmPopulation) GetAnyNodes(includeIndexed bool, shuffle bool) []*NodeAppearance
- func (r *FixedRealmPopulation) GetIndexedCount() int
- func (r *FixedRealmPopulation) GetIndexedNodes() []*NodeAppearance
- func (r *FixedRealmPopulation) GetIndexedNodesAndHasNil() ([]*NodeAppearance, bool)
- func (r *FixedRealmPopulation) GetNodeAppearance(id node.ShortNodeID) *NodeAppearance
- func (r *FixedRealmPopulation) GetNodeAppearanceByIndex(idx int) *NodeAppearance
- func (r *FixedRealmPopulation) GetSealedCapacity() (int, bool)
- func (r *FixedRealmPopulation) GetShuffledOtherNodes() []*NodeAppearance
- func (r *FixedRealmPopulation) NotifyAllOnAdded()
- func (r *FixedRealmPopulation) SealIndexed(indexedCountLimit int) bool
- type Hook
- func (p *Hook) GetBlameFactory() misbehavior.BlameFactory
- func (p *Hook) GetCryptographyAssistant() transport.CryptographyAssistant
- func (p *Hook) GetEphemeralMode() api.EphemeralMode
- func (p *Hook) GetFraudFactory() misbehavior.FraudFactory
- func (p *Hook) GetLocalNodeID() node.ShortNodeID
- func (p *Hook) GetLocalProfile() profiles.ActiveNode
- func (p *Hook) GetNeighbourhoodTrustThreshold() uint8
- func (p *Hook) GetPopulationVersion() uint32
- func (p *Hook) GetPulseData() pulse.DataHolder
- func (p *Hook) UpdatePopulationVersion() uint32
- type MemberPacketSender
- type MembershipApplyFunc
- type NodeAppearance
- func NewAscendedNodeAppearance(np profiles.ActiveNode, limiter phases.PacketLimiter, ...) NodeAppearance
- func NewEmptyNodeAppearance(np profiles.ActiveNode) NodeAppearance
- func NewLocalJoinerNodeAppearance(np profiles.ActiveNode, announcerID node.ShortNodeID, ...) NodeAppearance
- func NewNodeAppearance(np profiles.ActiveNode, baselineWeight uint32, limiter phases.PacketLimiter, ...) NodeAppearance
- func NewNodeAppearanceAsSelf(np profiles.LocalNode, powerRequest power.Request, hook *Hook) NodeAppearance
- func (c *NodeAppearance) ApplyNeighbourEvidence(witness *NodeAppearance, mp profiles.MemberAnnouncement, cappedTrust bool, ...) (bool, error)
- func (c *NodeAppearance) ApplyNodeMembership(mp profiles.MemberAnnouncement, applyAfterChecks MembershipApplyFunc) (bool, error)
- func (c *NodeAppearance) Blames() misbehavior.BlameFactory
- func (c *NodeAppearance) CanIntroduceJoiner() bool
- func (c *NodeAppearance) CanReceivePacket(pt phases.PacketType) bool
- func (c *NodeAppearance) CopySelfTo(target *NodeAppearance)
- func (c *NodeAppearance) DispatchAnnouncement(ctx context.Context, rank member.Rank, profile profiles.StaticProfile, ...) error
- func (c *NodeAppearance) DispatchMemberPacket(ctx context.Context, packet transport.PacketParser, from endpoints.Inbound, ...) error
- func (c *NodeAppearance) EncryptJoinerSecret(joinerSecret cryptkit.DigestHolder) cryptkit.DigestHolder
- func (c *NodeAppearance) Frauds() misbehavior.FraudFactory
- func (c *NodeAppearance) GetAnnouncementAsJoiner() *transport.JoinerAnnouncement
- func (c *NodeAppearance) GetIndex() member.Index
- func (c *NodeAppearance) GetNeighborTrustThreshold() uint8
- func (c *NodeAppearance) GetNeighbourWeight() uint32
- func (c *NodeAppearance) GetNodeID() node.ShortNodeID
- func (c *NodeAppearance) GetNodeMembershipProfile() profiles.MembershipProfile
- func (c *NodeAppearance) GetNodeMembershipProfileOrEmpty() profiles.MembershipProfile
- func (c *NodeAppearance) GetNodeTrustAndMembershipOrEmpty() (profiles.MembershipProfile, member.TrustLevel)
- func (c *NodeAppearance) GetPacketHandler(i int) DispatchMemberPacketFunc
- func (c *NodeAppearance) GetProfile() profiles.ActiveNode
- func (c *NodeAppearance) GetRank(nodeCount int) member.Rank
- func (c *NodeAppearance) GetReportProfile() profiles.BaseNode
- func (c *NodeAppearance) GetRequestedAnnouncement() profiles.MembershipAnnouncement
- func (c *NodeAppearance) GetRequestedLeave() (bool, uint32)
- func (c *NodeAppearance) GetRequestedState() NodeRequestedState
- func (c *NodeAppearance) GetSignatureVerifier() cryptkit.SignatureVerifier
- func (c *NodeAppearance) GetStatelessAnnouncementEvidence() cryptkit.SignedDigestHolder
- func (c *NodeAppearance) GetStatic() profiles.StaticProfile
- func (c *NodeAppearance) GetTrustLevel() member.TrustLevel
- func (c *NodeAppearance) HasAnyPacketReceived() bool
- func (c *NodeAppearance) IsJoiner() bool
- func (c *NodeAppearance) IsLocal() bool
- func (c *NodeAppearance) IsNSHRequired() bool
- func (c *NodeAppearance) IsStateful() bool
- func (c *NodeAppearance) NotifyOnCustom(event interface{})
- func (c *NodeAppearance) RegisterBlame(blame misbehavior.BlameError)
- func (c *NodeAppearance) RegisterFraud(fraud misbehavior.FraudError) error
- func (c *NodeAppearance) SetLocalNodeState(ma profiles.MemberAnnouncement) bool
- func (c *NodeAppearance) SetPacketReceived(pt phases.PacketType) bool
- func (c *NodeAppearance) SetPacketSent(pt phases.PacketType) bool
- func (c *NodeAppearance) String() string
- func (c *NodeAppearance) UnsafeEnsureStateAvailable()
- func (c *NodeAppearance) UpdateNodeTrustLevel(trust member.TrustLevel) bool
- func (c *NodeAppearance) UpgradeDynamicNodeProfile(ctx context.Context, full transport.FullIntroductionReader) bool
- func (c *NodeAppearance) VerifyPacketAuthenticity(ps cryptkit.SignedDigest, from endpoints.Inbound, strictFrom bool) error
- type NodeRequestedState
- type PacketDispatcher
- type RealmPopulation
- type RealmVectorHelper
- type RealmVectorProjection
- func (p *RealmVectorProjection) CreateProjection() RealmVectorProjection
- func (p *RealmVectorProjection) ForceEntryUpdate(index int) bool
- func (p *RealmVectorProjection) GetIndexedCount() int
- func (p *RealmVectorProjection) GetSortedCount() int
- func (p *RealmVectorProjection) HasSameVersion(version uint32) bool
- func (p *RealmVectorProjection) ScanIndexed(apply func(index int, nodeData nodeset.VectorEntryData))
- func (p *RealmVectorProjection) ScanSorted(apply nodeset.EntryApplyFunc, filterValue uint32)
- func (p *RealmVectorProjection) ScanSortedWithFilter(parentFilter uint32, apply nodeset.EntryApplyFunc, ...)
- type SharedNodeContext
- type UpdateFlags
- type VectorEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LessByNeighbourWeightForNodeAppearance ¶
func LessByNeighbourWeightForNodeAppearance(n1, n2 interface{}) bool
func ShuffleNodeAppearances ¶
func ShuffleNodeAppearances(shuffleFunc args.ShuffleFunc, nodeRefs []*NodeAppearance)
Types ¶
type AtomicEventStats ¶
type AtomicEventStats struct {
// contains filtered or unexported fields
}
func (*AtomicEventStats) GetDynamicCounts ¶
func (p *AtomicEventStats) GetDynamicCounts() (briefCount, fullCount uint16)
func (*AtomicEventStats) GetPurgatoryCounts ¶
func (p *AtomicEventStats) GetPurgatoryCounts() (addedCount, ascentCount uint16)
func (*AtomicEventStats) GetTrustCounts ¶
func (p *AtomicEventStats) GetTrustCounts() (fraudCount, bySelfCount, bySomeCount, byNeighborsCount uint16)
func (*AtomicEventStats) OnCustomEvent ¶
func (p *AtomicEventStats) OnCustomEvent(populationVersion uint32, n *NodeAppearance, event interface{})
func (*AtomicEventStats) OnDynamicNodeUpdate ¶
func (p *AtomicEventStats) OnDynamicNodeUpdate(populationVersion uint32, n *NodeAppearance, flags UpdateFlags)
func (*AtomicEventStats) OnDynamicPopulationCompleted ¶
func (p *AtomicEventStats) OnDynamicPopulationCompleted(populationVersion uint32, indexedCount int)
func (*AtomicEventStats) OnNodeStateAssigned ¶
func (p *AtomicEventStats) OnNodeStateAssigned(populationVersion uint32, n *NodeAppearance)
func (*AtomicEventStats) OnPurgatoryNodeUpdate ¶
func (p *AtomicEventStats) OnPurgatoryNodeUpdate(populationVersion uint32, n MemberPacketSender, flags UpdateFlags)
func (*AtomicEventStats) OnTrustUpdated ¶
func (p *AtomicEventStats) OnTrustUpdated(populationVersion uint32, n *NodeAppearance, trustBefore member.TrustLevel, trustAfter member.TrustLevel, hasFullProfile bool)
type DispatchFactoryFunc ¶
type DispatchFactoryFunc func(ctx context.Context, n *NodeAppearance) []DispatchMemberPacketFunc
type DispatchMemberPacketFunc ¶
type DispatchMemberPacketFunc func(ctx context.Context, packet transport.MemberPacketReader, from *NodeAppearance) error
type DynamicRealmPopulation ¶
type DynamicRealmPopulation struct {
// contains filtered or unexported fields
}
func NewDynamicRealmPopulation ¶
func NewDynamicRealmPopulation(population census.OnlinePopulation, nodeCountHint int, phase2ExtLimit uint8, shuffleFn args.ShuffleFunc, baselineWeight uint32, hookCfg SharedNodeContext, fn DispatchFactoryFunc) *DynamicRealmPopulation
func (*DynamicRealmPopulation) AddReservation ¶
func (p *DynamicRealmPopulation) AddReservation(id node.ShortNodeID) (bool, *NodeAppearance)
func (*DynamicRealmPopulation) AddToDynamics ¶
func (p *DynamicRealmPopulation) AddToDynamics(ctx context.Context, na *NodeAppearance) (*NodeAppearance, error)
func (*DynamicRealmPopulation) CreatePacketLimiter ¶
func (p *DynamicRealmPopulation) CreatePacketLimiter(isJoiner bool) phases.PacketLimiter
func (*DynamicRealmPopulation) CreateVectorHelper ¶
func (p *DynamicRealmPopulation) CreateVectorHelper() *RealmVectorHelper
func (*DynamicRealmPopulation) FindReservation ¶
func (p *DynamicRealmPopulation) FindReservation(id node.ShortNodeID) (bool, *NodeAppearance)
func (*DynamicRealmPopulation) GetActiveNodeAppearance ¶
func (p *DynamicRealmPopulation) GetActiveNodeAppearance(id node.ShortNodeID) *NodeAppearance
func (*DynamicRealmPopulation) GetAnyNodes ¶
func (p *DynamicRealmPopulation) GetAnyNodes(includeIndexed bool, shuffle bool) []*NodeAppearance
func (*DynamicRealmPopulation) GetDynamicCounts ¶
func (p *DynamicRealmPopulation) GetDynamicCounts() (briefCount, fullCount uint16)
func (*DynamicRealmPopulation) GetHook ¶
func (p *DynamicRealmPopulation) GetHook() *Hook
func (*DynamicRealmPopulation) GetIndexedCount ¶
func (p *DynamicRealmPopulation) GetIndexedCount() int
func (*DynamicRealmPopulation) GetIndexedCountAndCompleteness ¶
func (p *DynamicRealmPopulation) GetIndexedCountAndCompleteness() (int, bool)
func (*DynamicRealmPopulation) GetIndexedNodes ¶
func (p *DynamicRealmPopulation) GetIndexedNodes() []*NodeAppearance
func (*DynamicRealmPopulation) GetIndexedNodesAndHasNil ¶
func (p *DynamicRealmPopulation) GetIndexedNodesAndHasNil() ([]*NodeAppearance, bool)
func (*DynamicRealmPopulation) GetJoinerNodeAppearance ¶
func (p *DynamicRealmPopulation) GetJoinerNodeAppearance(id node.ShortNodeID) *NodeAppearance
func (*DynamicRealmPopulation) GetJoinersCount ¶
func (p *DynamicRealmPopulation) GetJoinersCount() int
func (*DynamicRealmPopulation) GetNodeAppearance ¶
func (p *DynamicRealmPopulation) GetNodeAppearance(id node.ShortNodeID) *NodeAppearance
func (*DynamicRealmPopulation) GetNodeAppearanceByIndex ¶
func (p *DynamicRealmPopulation) GetNodeAppearanceByIndex(idx int) *NodeAppearance
func (*DynamicRealmPopulation) GetPurgatoryCounts ¶
func (p *DynamicRealmPopulation) GetPurgatoryCounts() (addedCount, ascentCount uint16)
func (*DynamicRealmPopulation) GetSealedCapacity ¶
func (p *DynamicRealmPopulation) GetSealedCapacity() (int, bool)
func (*DynamicRealmPopulation) GetSelf ¶
func (p *DynamicRealmPopulation) GetSelf() *NodeAppearance
func (*DynamicRealmPopulation) GetShuffledOtherNodes ¶
func (p *DynamicRealmPopulation) GetShuffledOtherNodes() []*NodeAppearance
func (*DynamicRealmPopulation) GetTrustCounts ¶
func (p *DynamicRealmPopulation) GetTrustCounts() (fraudCount, bySelfCount, bySomeCount, byNeighborsCount uint16)
func (*DynamicRealmPopulation) InitCallback ¶
func (p *DynamicRealmPopulation) InitCallback(callback EventDispatcher)
must be set before parallel use
func (*DynamicRealmPopulation) NotifyAllOnAdded ¶
func (p *DynamicRealmPopulation) NotifyAllOnAdded()
func (*DynamicRealmPopulation) SealIndexed ¶
func (p *DynamicRealmPopulation) SealIndexed(indexedCountLimit int) bool
type EventClosureFunc ¶
type EventClosureFunc func(EventDispatcher)
type EventDispatchFunc ¶
type EventDispatchFunc func(EventClosureFunc)
func GetEventDispatchFn ¶
func GetEventDispatchFn(intercept EventDispatcher, sink EventDispatchFunc) EventDispatchFunc
type EventDispatcher ¶
type EventDispatcher interface {
// contains filtered or unexported methods
}
func NewIgnoringDispatcher ¶
func NewIgnoringDispatcher() EventDispatcher
func NewInterceptor ¶
func NewInterceptor(intercept EventDispatcher) EventDispatcher
func NewInterceptorAndSink ¶
func NewInterceptorAndSink(intercept EventDispatcher, sink EventDispatchFunc) EventDispatcher
func NewPanicDispatcher ¶
func NewPanicDispatcher(panicMsg string) EventDispatcher
func NewSinkDispatcher ¶
func NewSinkDispatcher(sink EventDispatchFunc) EventDispatcher
type EventWrapper ¶
type EventWrapper struct {
// contains filtered or unexported fields
}
func (*EventWrapper) OnCustomEvent ¶
func (p *EventWrapper) OnCustomEvent(populationVersion uint32, n *NodeAppearance, event interface{})
func (*EventWrapper) OnDynamicNodeUpdate ¶
func (p *EventWrapper) OnDynamicNodeUpdate(populationVersion uint32, n *NodeAppearance, flags UpdateFlags)
func (*EventWrapper) OnDynamicPopulationCompleted ¶
func (p *EventWrapper) OnDynamicPopulationCompleted(populationVersion uint32, indexedCount int)
func (*EventWrapper) OnNodeStateAssigned ¶
func (p *EventWrapper) OnNodeStateAssigned(populationVersion uint32, n *NodeAppearance)
func (*EventWrapper) OnPurgatoryNodeUpdate ¶
func (p *EventWrapper) OnPurgatoryNodeUpdate(populationVersion uint32, n MemberPacketSender, flags UpdateFlags)
func (*EventWrapper) OnTrustUpdated ¶
func (p *EventWrapper) OnTrustUpdated(populationVersion uint32, n *NodeAppearance, before member.TrustLevel, after member.TrustLevel, hasFullProfile bool)
type FixedRealmPopulation ¶
type FixedRealmPopulation struct {
// contains filtered or unexported fields
}
func NewFixedRealmPopulation ¶
func NewFixedRealmPopulation(population census.OnlinePopulation, phase2ExtLimit uint8, shuffleFn args.ShuffleFunc, baselineWeight uint32, hookCfg SharedNodeContext, fn DispatchFactoryFunc) *FixedRealmPopulation
func (*FixedRealmPopulation) AddToDynamics ¶
func (r *FixedRealmPopulation) AddToDynamics(ctx context.Context, n *NodeAppearance) (*NodeAppearance, error)
func (*FixedRealmPopulation) CreateVectorHelper ¶
func (r *FixedRealmPopulation) CreateVectorHelper() *RealmVectorHelper
func (*FixedRealmPopulation) GetActiveNodeAppearance ¶
func (r *FixedRealmPopulation) GetActiveNodeAppearance(id node.ShortNodeID) *NodeAppearance
func (*FixedRealmPopulation) GetAnyNodes ¶
func (r *FixedRealmPopulation) GetAnyNodes(includeIndexed bool, shuffle bool) []*NodeAppearance
func (*FixedRealmPopulation) GetIndexedCount ¶
func (r *FixedRealmPopulation) GetIndexedCount() int
func (*FixedRealmPopulation) GetIndexedNodes ¶
func (r *FixedRealmPopulation) GetIndexedNodes() []*NodeAppearance
func (*FixedRealmPopulation) GetIndexedNodesAndHasNil ¶
func (r *FixedRealmPopulation) GetIndexedNodesAndHasNil() ([]*NodeAppearance, bool)
func (*FixedRealmPopulation) GetNodeAppearance ¶
func (r *FixedRealmPopulation) GetNodeAppearance(id node.ShortNodeID) *NodeAppearance
func (*FixedRealmPopulation) GetNodeAppearanceByIndex ¶
func (r *FixedRealmPopulation) GetNodeAppearanceByIndex(idx int) *NodeAppearance
func (*FixedRealmPopulation) GetSealedCapacity ¶
func (r *FixedRealmPopulation) GetSealedCapacity() (int, bool)
func (*FixedRealmPopulation) GetShuffledOtherNodes ¶
func (r *FixedRealmPopulation) GetShuffledOtherNodes() []*NodeAppearance
func (*FixedRealmPopulation) NotifyAllOnAdded ¶
func (r *FixedRealmPopulation) NotifyAllOnAdded()
func (*FixedRealmPopulation) SealIndexed ¶
func (r *FixedRealmPopulation) SealIndexed(indexedCountLimit int) bool
type Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
func NewHook ¶
func NewHook(localNode profiles.ActiveNode, eventDispatcher EventDispatcher, hookCfg SharedNodeContext) Hook
func (*Hook) GetBlameFactory ¶
func (p *Hook) GetBlameFactory() misbehavior.BlameFactory
func (*Hook) GetCryptographyAssistant ¶
func (p *Hook) GetCryptographyAssistant() transport.CryptographyAssistant
func (*Hook) GetEphemeralMode ¶
func (p *Hook) GetEphemeralMode() api.EphemeralMode
func (*Hook) GetFraudFactory ¶
func (p *Hook) GetFraudFactory() misbehavior.FraudFactory
func (*Hook) GetLocalNodeID ¶
func (p *Hook) GetLocalNodeID() node.ShortNodeID
func (*Hook) GetLocalProfile ¶
func (p *Hook) GetLocalProfile() profiles.ActiveNode
func (*Hook) GetNeighbourhoodTrustThreshold ¶
func (*Hook) GetPopulationVersion ¶
func (*Hook) GetPulseData ¶
func (p *Hook) GetPulseData() pulse.DataHolder
func (*Hook) UpdatePopulationVersion ¶
type MemberPacketSender ¶
type MemberPacketSender interface { transport.TargetProfile SetPacketSent(pt phases.PacketType) bool }
type MembershipApplyFunc ¶
type MembershipApplyFunc func(ma profiles.MemberAnnouncement) error
type NodeAppearance ¶
type NodeAppearance struct {
// contains filtered or unexported fields
}
func NewAscendedNodeAppearance ¶
func NewAscendedNodeAppearance(np profiles.ActiveNode, limiter phases.PacketLimiter, announcerID node.ShortNodeID, joinerSecret cryptkit.DigestHolder) NodeAppearance
func NewEmptyNodeAppearance ¶
func NewEmptyNodeAppearance(np profiles.ActiveNode) NodeAppearance
func NewLocalJoinerNodeAppearance ¶
func NewLocalJoinerNodeAppearance(np profiles.ActiveNode, announcerID node.ShortNodeID, joinerSecret cryptkit.DigestHolder) NodeAppearance
func NewNodeAppearance ¶
func NewNodeAppearance(np profiles.ActiveNode, baselineWeight uint32, limiter phases.PacketLimiter, hook *Hook, handlers []DispatchMemberPacketFunc) NodeAppearance
func NewNodeAppearanceAsSelf ¶
func (*NodeAppearance) ApplyNeighbourEvidence ¶
func (c *NodeAppearance) ApplyNeighbourEvidence(witness *NodeAppearance, mp profiles.MemberAnnouncement, cappedTrust bool, applyAfterChecks MembershipApplyFunc) (bool, error)
Evidence MUST be verified before this call
func (*NodeAppearance) ApplyNodeMembership ¶
func (c *NodeAppearance) ApplyNodeMembership(mp profiles.MemberAnnouncement, applyAfterChecks MembershipApplyFunc) (bool, error)
Evidence MUST be verified before this call
func (*NodeAppearance) Blames ¶
func (c *NodeAppearance) Blames() misbehavior.BlameFactory
func (*NodeAppearance) CanIntroduceJoiner ¶
func (c *NodeAppearance) CanIntroduceJoiner() bool
func (*NodeAppearance) CanReceivePacket ¶
func (c *NodeAppearance) CanReceivePacket(pt phases.PacketType) bool
func (*NodeAppearance) CopySelfTo ¶
func (c *NodeAppearance) CopySelfTo(target *NodeAppearance)
LOCK - self, target must be safe
func (*NodeAppearance) DispatchAnnouncement ¶
func (c *NodeAppearance) DispatchAnnouncement(ctx context.Context, rank member.Rank, profile profiles.StaticProfile, announcement profiles.MemberAnnouncement) error
func (*NodeAppearance) DispatchMemberPacket ¶
func (c *NodeAppearance) DispatchMemberPacket(ctx context.Context, packet transport.PacketParser, from endpoints.Inbound, flags coreapi.PacketVerifyFlags, pd PacketDispatcher) error
func (*NodeAppearance) EncryptJoinerSecret ¶
func (c *NodeAppearance) EncryptJoinerSecret(joinerSecret cryptkit.DigestHolder) cryptkit.DigestHolder
func (*NodeAppearance) Frauds ¶
func (c *NodeAppearance) Frauds() misbehavior.FraudFactory
func (*NodeAppearance) GetAnnouncementAsJoiner ¶
func (c *NodeAppearance) GetAnnouncementAsJoiner() *transport.JoinerAnnouncement
func (*NodeAppearance) GetIndex ¶
func (c *NodeAppearance) GetIndex() member.Index
func (*NodeAppearance) GetNeighborTrustThreshold ¶
func (c *NodeAppearance) GetNeighborTrustThreshold() uint8
func (*NodeAppearance) GetNeighbourWeight ¶
func (c *NodeAppearance) GetNeighbourWeight() uint32
func (*NodeAppearance) GetNodeID ¶
func (c *NodeAppearance) GetNodeID() node.ShortNodeID
func (*NodeAppearance) GetNodeMembershipProfile ¶
func (c *NodeAppearance) GetNodeMembershipProfile() profiles.MembershipProfile
func (*NodeAppearance) GetNodeMembershipProfileOrEmpty ¶
func (c *NodeAppearance) GetNodeMembershipProfileOrEmpty() profiles.MembershipProfile
func (*NodeAppearance) GetNodeTrustAndMembershipOrEmpty ¶
func (c *NodeAppearance) GetNodeTrustAndMembershipOrEmpty() (profiles.MembershipProfile, member.TrustLevel)
func (*NodeAppearance) GetPacketHandler ¶
func (c *NodeAppearance) GetPacketHandler(i int) DispatchMemberPacketFunc
func (*NodeAppearance) GetProfile ¶
func (c *NodeAppearance) GetProfile() profiles.ActiveNode
func (*NodeAppearance) GetReportProfile ¶
func (c *NodeAppearance) GetReportProfile() profiles.BaseNode
func (*NodeAppearance) GetRequestedAnnouncement ¶
func (c *NodeAppearance) GetRequestedAnnouncement() profiles.MembershipAnnouncement
func (*NodeAppearance) GetRequestedLeave ¶
func (c *NodeAppearance) GetRequestedLeave() (bool, uint32)
func (*NodeAppearance) GetRequestedState ¶
func (c *NodeAppearance) GetRequestedState() NodeRequestedState
func (*NodeAppearance) GetSignatureVerifier ¶
func (c *NodeAppearance) GetSignatureVerifier() cryptkit.SignatureVerifier
func (*NodeAppearance) GetStatelessAnnouncementEvidence ¶
func (c *NodeAppearance) GetStatelessAnnouncementEvidence() cryptkit.SignedDigestHolder
func (*NodeAppearance) GetStatic ¶
func (c *NodeAppearance) GetStatic() profiles.StaticProfile
func (*NodeAppearance) GetTrustLevel ¶
func (c *NodeAppearance) GetTrustLevel() member.TrustLevel
func (*NodeAppearance) HasAnyPacketReceived ¶
func (c *NodeAppearance) HasAnyPacketReceived() bool
func (*NodeAppearance) IsJoiner ¶
func (c *NodeAppearance) IsJoiner() bool
func (*NodeAppearance) IsLocal ¶
func (c *NodeAppearance) IsLocal() bool
func (*NodeAppearance) IsNSHRequired ¶
func (c *NodeAppearance) IsNSHRequired() bool
func (*NodeAppearance) IsStateful ¶
func (c *NodeAppearance) IsStateful() bool
func (*NodeAppearance) NotifyOnCustom ¶
func (c *NodeAppearance) NotifyOnCustom(event interface{})
func (*NodeAppearance) RegisterBlame ¶
func (c *NodeAppearance) RegisterBlame(blame misbehavior.BlameError)
func (*NodeAppearance) RegisterFraud ¶
func (c *NodeAppearance) RegisterFraud(fraud misbehavior.FraudError) error
func (*NodeAppearance) SetLocalNodeState ¶
func (c *NodeAppearance) SetLocalNodeState(ma profiles.MemberAnnouncement) bool
func (*NodeAppearance) SetPacketReceived ¶
func (c *NodeAppearance) SetPacketReceived(pt phases.PacketType) bool
func (*NodeAppearance) SetPacketSent ¶
func (c *NodeAppearance) SetPacketSent(pt phases.PacketType) bool
func (*NodeAppearance) String ¶
func (c *NodeAppearance) String() string
func (*NodeAppearance) UnsafeEnsureStateAvailable ¶
func (c *NodeAppearance) UnsafeEnsureStateAvailable()
MUST be used under lock, used for fast-fail detection in event handler
func (*NodeAppearance) UpdateNodeTrustLevel ¶
func (c *NodeAppearance) UpdateNodeTrustLevel(trust member.TrustLevel) bool
func (*NodeAppearance) UpgradeDynamicNodeProfile ¶
func (c *NodeAppearance) UpgradeDynamicNodeProfile(ctx context.Context, full transport.FullIntroductionReader) bool
deprecated
replace with DispatchAnnouncement
func (*NodeAppearance) VerifyPacketAuthenticity ¶
func (c *NodeAppearance) VerifyPacketAuthenticity(ps cryptkit.SignedDigest, from endpoints.Inbound, strictFrom bool) error
type NodeRequestedState ¶
type NodeRequestedState struct { profiles.MembershipProfile LeaveReason uint32 TrustLevel member.TrustLevel IsLeaving bool RequestedMode member.OpMode JoinerID node.ShortNodeID }
type PacketDispatcher ¶
type PacketDispatcher interface { HasCustomVerifyForHost(from endpoints.Inbound, verifyFlags coreapi.PacketVerifyFlags) bool DispatchHostPacket(ctx context.Context, packet transport.PacketParser, from endpoints.Inbound, flags coreapi.PacketVerifyFlags) error /* This method can validate and create a member, but MUST NOT apply any changes to members etc */ TriggerUnknownMember(ctx context.Context, memberID node.ShortNodeID, packet transport.MemberPacketReader, from endpoints.Inbound) (bool, error) DispatchMemberPacket(ctx context.Context, packet transport.MemberPacketReader, source *NodeAppearance) error }
type RealmPopulation ¶
type RealmPopulation interface { GetIndexedCount() int GetJoinersCount() int GetSealedCapacity() (int, bool) SealIndexed(indexedCapacity int) bool GetNodeAppearance(id node.ShortNodeID) *NodeAppearance GetActiveNodeAppearance(id node.ShortNodeID) *NodeAppearance GetJoinerNodeAppearance(id node.ShortNodeID) *NodeAppearance GetNodeAppearanceByIndex(idx int) *NodeAppearance GetShuffledOtherNodes() []*NodeAppearance /* excludes joiners and self */ GetIndexedNodes() []*NodeAppearance /* no joiners included */ GetIndexedNodesAndHasNil() ([]*NodeAppearance, bool) GetIndexedCountAndCompleteness() (int, bool) GetSelf() *NodeAppearance // CreateNodeAppearance(ctx context.Context, inp profiles.ActiveNode) *NodeAppearance AddReservation(id node.ShortNodeID) (bool, *NodeAppearance) FindReservation(id node.ShortNodeID) (bool, *NodeAppearance) AddToDynamics(ctx context.Context, n *NodeAppearance) (*NodeAppearance, error) GetAnyNodes(includeIndexed bool, shuffle bool) []*NodeAppearance CreateVectorHelper() *RealmVectorHelper CreatePacketLimiter(isJoiner bool) phases.PacketLimiter GetTrustCounts() (fraudCount, bySelfCount, bySomeCount, byNeighborsCount uint16) GetDynamicCounts() (briefCount, fullCount uint16) GetPurgatoryCounts() (addedCount, ascentCount uint16) }
type RealmVectorHelper ¶
type RealmVectorHelper struct {
// contains filtered or unexported fields
}
func (*RealmVectorHelper) CreateProjection ¶
func (p *RealmVectorHelper) CreateProjection() RealmVectorProjection
func (*RealmVectorHelper) CreateUnsafeProjection ¶
func (p *RealmVectorHelper) CreateUnsafeProjection() RealmVectorProjection
type RealmVectorProjection ¶
type RealmVectorProjection struct {
// contains filtered or unexported fields
}
Unsafe for concurrent use
func (*RealmVectorProjection) CreateProjection ¶
func (p *RealmVectorProjection) CreateProjection() RealmVectorProjection
func (*RealmVectorProjection) ForceEntryUpdate ¶
func (p *RealmVectorProjection) ForceEntryUpdate(index int) bool
func (*RealmVectorProjection) GetIndexedCount ¶
func (p *RealmVectorProjection) GetIndexedCount() int
func (*RealmVectorProjection) GetSortedCount ¶
func (p *RealmVectorProjection) GetSortedCount() int
func (*RealmVectorProjection) HasSameVersion ¶
func (p *RealmVectorProjection) HasSameVersion(version uint32) bool
func (*RealmVectorProjection) ScanIndexed ¶
func (p *RealmVectorProjection) ScanIndexed(apply func(index int, nodeData nodeset.VectorEntryData))
func (*RealmVectorProjection) ScanSorted ¶
func (p *RealmVectorProjection) ScanSorted(apply nodeset.EntryApplyFunc, filterValue uint32)
func (*RealmVectorProjection) ScanSortedWithFilter ¶
func (p *RealmVectorProjection) ScanSortedWithFilter(parentFilter uint32, apply nodeset.EntryApplyFunc, filter nodeset.EntryFilterFunc)
type SharedNodeContext ¶
type SharedNodeContext struct {}
func NewSharedNodeContext ¶
func NewSharedNodeContext(assistant transport.CryptographyAssistant, pdh pulse.DataHolder, nbTrustThreshold uint8, ephemeralMode api.EphemeralMode, capture misbehavior.ReportFunc) SharedNodeContext
func NewSharedNodeContextByPulseNumber ¶
func NewSharedNodeContextByPulseNumber(assistant transport.CryptographyAssistant, pn pulse.Number, nbTrustThreshold uint8, ephemeralMode api.EphemeralMode, capture misbehavior.ReportFunc) SharedNodeContext
type UpdateFlags ¶
type UpdateFlags uint32
const ( FlagCreated UpdateFlags = 1 << iota FlagFixedInit // for indexed members of a fixed population FlagUpdatedProfile FlagAscent // for purgatory nodes )
type VectorEntry ¶
type VectorEntry struct { nodeset.VectorEntryData // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.