Documentation ¶
Index ¶
- Constants
- func Is(err error) bool
- func IsFraud(err error) bool
- type BlameError
- func (p BlameError) BlameType() int
- func (p *BlameError) CaptureMark() interface{}
- func (p *BlameError) Details() []interface{}
- func (p BlameError) Error() string
- func (p *BlameError) IsUnknown() bool
- func (p *BlameError) MisbehaviorType() Type
- func (p *BlameError) ViolatorHost() endpoints.InboundConnection
- func (p *BlameError) ViolatorNode() profiles.BaseNode
- type BlameFactory
- func (p BlameFactory) ExcessiveIntro(violator profiles.BaseNode, evidence1 cryptkit.SignedEvidenceHolder, ...) BlameError
- func (p BlameFactory) NewBlame(fraudType int, msg string, violatorHost endpoints.Inbound, ...) BlameError
- func (p BlameFactory) NewHostBlame(fraudType int, msg string, violatorHost endpoints.Inbound, ...) BlameError
- func (p BlameFactory) NewMismatchedPulsarPacket(from endpoints.Inbound, expected proofs.OriginalPulsarPacket, ...) BlameError
- func (p BlameFactory) NewMismatchedPulsePacket(from profiles.BaseNode, expected proofs.OriginalPulsarPacket, ...) BlameError
- func (p BlameFactory) NewNodeBlame(fraudType int, msg string, violatorNode profiles.BaseNode, ...) BlameError
- func (p BlameFactory) NewProtocolViolation(violator profiles.BaseNode, msg string) BlameError
- type Category
- type FraudError
- func (p *FraudError) CaptureMark() interface{}
- func (p *FraudError) Details() []interface{}
- func (p FraudError) Error() string
- func (p FraudError) FraudType() int
- func (p *FraudError) IsUnknown() bool
- func (p *FraudError) MisbehaviorType() Type
- func (p *FraudError) ViolatorHost() endpoints.InboundConnection
- func (p *FraudError) ViolatorNode() profiles.BaseNode
- type FraudFactory
- func (p FraudFactory) NewFraud(fraudType int, msg string, violatorHost endpoints.Inbound, ...) FraudError
- func (p FraudFactory) NewHostFraud(fraudType int, msg string, violatorHost endpoints.Inbound, ...) FraudError
- func (p FraudFactory) NewInconsistentMembershipAnnouncement(violator profiles.ActiveNode, evidence1 profiles.MembershipAnnouncement, ...) FraudError
- func (p FraudFactory) NewInconsistentNeighbourAnnouncement(violator profiles.BaseNode) FraudError
- func (p FraudFactory) NewInvalidPowerLevel(violator profiles.BaseNode) FraudError
- func (p FraudFactory) NewMismatchedMembershipRank(violator profiles.ActiveNode, mp profiles.MembershipProfile) FraudError
- func (p FraudFactory) NewMismatchedMembershipRankOrNodeCount(violator profiles.ActiveNode, mp profiles.MembershipProfile, nodeCount int) FraudError
- func (p FraudFactory) NewMismatchedNeighbourRank(violator profiles.BaseNode) error
- func (p FraudFactory) NewNeighbourContainsSource(violator profiles.BaseNode) error
- func (p FraudFactory) NewNeighbourMissingTarget(violator profiles.BaseNode) error
- func (p FraudFactory) NewNodeFraud(fraudType int, msg string, violatorNode profiles.BaseNode, ...) FraudError
- func (p FraudFactory) NewUnknownNeighbour(violator profiles.BaseNode) error
- type Report
- type ReportFunc
- type ReportMock
- func (mmCaptureMark *ReportMock) CaptureMark() (p1 interface{})
- func (mmCaptureMark *ReportMock) CaptureMarkAfterCounter() uint64
- func (mmCaptureMark *ReportMock) CaptureMarkBeforeCounter() uint64
- func (mmDetails *ReportMock) Details() (pa1 []interface{})
- func (mmDetails *ReportMock) DetailsAfterCounter() uint64
- func (mmDetails *ReportMock) DetailsBeforeCounter() uint64
- func (m *ReportMock) MinimockCaptureMarkDone() bool
- func (m *ReportMock) MinimockCaptureMarkInspect()
- func (m *ReportMock) MinimockDetailsDone() bool
- func (m *ReportMock) MinimockDetailsInspect()
- func (m *ReportMock) MinimockFinish()
- func (m *ReportMock) MinimockMisbehaviorTypeDone() bool
- func (m *ReportMock) MinimockMisbehaviorTypeInspect()
- func (m *ReportMock) MinimockViolatorHostDone() bool
- func (m *ReportMock) MinimockViolatorHostInspect()
- func (m *ReportMock) MinimockViolatorNodeDone() bool
- func (m *ReportMock) MinimockViolatorNodeInspect()
- func (m *ReportMock) MinimockWait(timeout mm_time.Duration)
- func (mmMisbehaviorType *ReportMock) MisbehaviorType() (t1 Type)
- func (mmMisbehaviorType *ReportMock) MisbehaviorTypeAfterCounter() uint64
- func (mmMisbehaviorType *ReportMock) MisbehaviorTypeBeforeCounter() uint64
- func (mmViolatorHost *ReportMock) ViolatorHost() (i1 endpoints.InboundConnection)
- func (mmViolatorHost *ReportMock) ViolatorHostAfterCounter() uint64
- func (mmViolatorHost *ReportMock) ViolatorHostBeforeCounter() uint64
- func (mmViolatorNode *ReportMock) ViolatorNode() (b1 profiles.BaseNode)
- func (mmViolatorNode *ReportMock) ViolatorNodeAfterCounter() uint64
- func (mmViolatorNode *ReportMock) ViolatorNodeBeforeCounter() uint64
- type ReportMockCaptureMarkExpectation
- type ReportMockCaptureMarkResults
- type ReportMockDetailsExpectation
- type ReportMockDetailsResults
- type ReportMockMisbehaviorTypeExpectation
- type ReportMockMisbehaviorTypeResults
- type ReportMockViolatorHostExpectation
- type ReportMockViolatorHostResults
- type ReportMockViolatorNodeExpectation
- type ReportMockViolatorNodeResults
- type Type
Constants ¶
const ( BlameExcessiveIntro MismatchedPulsarPacket ProtocolViolation )
const ( FraudMultipleNsh MismatchedRank MismatchedNeighbour WrongPower )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlameError ¶
type BlameError struct {
// contains filtered or unexported fields
}
func (BlameError) BlameType ¶
func (p BlameError) BlameType() int
func (*BlameError) CaptureMark ¶
func (p *BlameError) CaptureMark() interface{}
func (*BlameError) Details ¶
func (p *BlameError) Details() []interface{}
func (BlameError) Error ¶
func (p BlameError) Error() string
func (*BlameError) IsUnknown ¶
func (p *BlameError) IsUnknown() bool
func (*BlameError) MisbehaviorType ¶
func (p *BlameError) MisbehaviorType() Type
func (*BlameError) ViolatorHost ¶
func (p *BlameError) ViolatorHost() endpoints.InboundConnection
func (*BlameError) ViolatorNode ¶
func (p *BlameError) ViolatorNode() profiles.BaseNode
type BlameFactory ¶
type BlameFactory struct {
// contains filtered or unexported fields
}
func NewBlameFactory ¶
func NewBlameFactory(capture ReportFunc) BlameFactory
func (BlameFactory) ExcessiveIntro ¶
func (p BlameFactory) ExcessiveIntro(violator profiles.BaseNode, evidence1 cryptkit.SignedEvidenceHolder, evidence2 cryptkit.SignedEvidenceHolder) BlameError
func (BlameFactory) NewBlame ¶
func (p BlameFactory) NewBlame(fraudType int, msg string, violatorHost endpoints.Inbound, violatorNode profiles.BaseNode, details ...interface{}) BlameError
func (BlameFactory) NewHostBlame ¶
func (p BlameFactory) NewHostBlame(fraudType int, msg string, violatorHost endpoints.Inbound, details ...interface{}) BlameError
func (BlameFactory) NewMismatchedPulsarPacket ¶
func (p BlameFactory) NewMismatchedPulsarPacket(from endpoints.Inbound, expected proofs.OriginalPulsarPacket, received proofs.OriginalPulsarPacket) BlameError
func (BlameFactory) NewMismatchedPulsePacket ¶
func (p BlameFactory) NewMismatchedPulsePacket(from profiles.BaseNode, expected proofs.OriginalPulsarPacket, received proofs.OriginalPulsarPacket) BlameError
func (BlameFactory) NewNodeBlame ¶
func (p BlameFactory) NewNodeBlame(fraudType int, msg string, violatorNode profiles.BaseNode, details ...interface{}) BlameError
func (BlameFactory) NewProtocolViolation ¶
func (p BlameFactory) NewProtocolViolation(violator profiles.BaseNode, msg string) BlameError
type FraudError ¶
type FraudError struct {
// contains filtered or unexported fields
}
func FraudOf ¶
func FraudOf(err error) *FraudError
func (*FraudError) CaptureMark ¶
func (p *FraudError) CaptureMark() interface{}
func (*FraudError) Details ¶
func (p *FraudError) Details() []interface{}
func (FraudError) Error ¶
func (p FraudError) Error() string
func (FraudError) FraudType ¶
func (p FraudError) FraudType() int
func (*FraudError) IsUnknown ¶
func (p *FraudError) IsUnknown() bool
func (*FraudError) MisbehaviorType ¶
func (p *FraudError) MisbehaviorType() Type
func (*FraudError) ViolatorHost ¶
func (p *FraudError) ViolatorHost() endpoints.InboundConnection
func (*FraudError) ViolatorNode ¶
func (p *FraudError) ViolatorNode() profiles.BaseNode
type FraudFactory ¶
type FraudFactory struct {
// contains filtered or unexported fields
}
func NewFraudFactory ¶
func NewFraudFactory(capture ReportFunc) FraudFactory
func (FraudFactory) NewFraud ¶
func (p FraudFactory) NewFraud(fraudType int, msg string, violatorHost endpoints.Inbound, violatorNode profiles.BaseNode, details ...interface{}) FraudError
func (FraudFactory) NewHostFraud ¶
func (p FraudFactory) NewHostFraud(fraudType int, msg string, violatorHost endpoints.Inbound, details ...interface{}) FraudError
func (FraudFactory) NewInconsistentMembershipAnnouncement ¶
func (p FraudFactory) NewInconsistentMembershipAnnouncement(violator profiles.ActiveNode, evidence1 profiles.MembershipAnnouncement, evidence2 profiles.MembershipAnnouncement) FraudError
nolint:interfacer
func (FraudFactory) NewInconsistentNeighbourAnnouncement ¶
func (p FraudFactory) NewInconsistentNeighbourAnnouncement(violator profiles.BaseNode) FraudError
func (FraudFactory) NewInvalidPowerLevel ¶
func (p FraudFactory) NewInvalidPowerLevel(violator profiles.BaseNode) FraudError
func (FraudFactory) NewMismatchedMembershipRank ¶
func (p FraudFactory) NewMismatchedMembershipRank(violator profiles.ActiveNode, mp profiles.MembershipProfile) FraudError
func (FraudFactory) NewMismatchedMembershipRankOrNodeCount ¶
func (p FraudFactory) NewMismatchedMembershipRankOrNodeCount(violator profiles.ActiveNode, mp profiles.MembershipProfile, nodeCount int) FraudError
nolint:interfacer
func (FraudFactory) NewMismatchedNeighbourRank ¶
func (p FraudFactory) NewMismatchedNeighbourRank(violator profiles.BaseNode) error
func (FraudFactory) NewNeighbourContainsSource ¶
func (p FraudFactory) NewNeighbourContainsSource(violator profiles.BaseNode) error
func (FraudFactory) NewNeighbourMissingTarget ¶
func (p FraudFactory) NewNeighbourMissingTarget(violator profiles.BaseNode) error
func (FraudFactory) NewNodeFraud ¶
func (p FraudFactory) NewNodeFraud(fraudType int, msg string, violatorNode profiles.BaseNode, details ...interface{}) FraudError
func (FraudFactory) NewUnknownNeighbour ¶
func (p FraudFactory) NewUnknownNeighbour(violator profiles.BaseNode) error
type Report ¶
type Report interface { CaptureMark() interface{} Details() []interface{} ViolatorNode() profiles.BaseNode ViolatorHost() endpoints.InboundConnection MisbehaviorType() Type }
type ReportFunc ¶
type ReportFunc func(report Report) interface{}
type ReportMock ¶
type ReportMock struct { CaptureMarkMock mReportMockCaptureMark DetailsMock mReportMockDetails MisbehaviorTypeMock mReportMockMisbehaviorType ViolatorHostMock mReportMockViolatorHost ViolatorNodeMock mReportMockViolatorNode // contains filtered or unexported fields }
ReportMock implements Report
func NewReportMock ¶
func NewReportMock(t minimock.Tester) *ReportMock
NewReportMock returns a mock for Report
func (*ReportMock) CaptureMark ¶
func (mmCaptureMark *ReportMock) CaptureMark() (p1 interface{})
CaptureMark implements Report
func (*ReportMock) CaptureMarkAfterCounter ¶
func (mmCaptureMark *ReportMock) CaptureMarkAfterCounter() uint64
CaptureMarkAfterCounter returns a count of finished ReportMock.CaptureMark invocations
func (*ReportMock) CaptureMarkBeforeCounter ¶
func (mmCaptureMark *ReportMock) CaptureMarkBeforeCounter() uint64
CaptureMarkBeforeCounter returns a count of ReportMock.CaptureMark invocations
func (*ReportMock) Details ¶
func (mmDetails *ReportMock) Details() (pa1 []interface{})
Details implements Report
func (*ReportMock) DetailsAfterCounter ¶
func (mmDetails *ReportMock) DetailsAfterCounter() uint64
DetailsAfterCounter returns a count of finished ReportMock.Details invocations
func (*ReportMock) DetailsBeforeCounter ¶
func (mmDetails *ReportMock) DetailsBeforeCounter() uint64
DetailsBeforeCounter returns a count of ReportMock.Details invocations
func (*ReportMock) MinimockCaptureMarkDone ¶
func (m *ReportMock) MinimockCaptureMarkDone() bool
MinimockCaptureMarkDone returns true if the count of the CaptureMark invocations corresponds the number of defined expectations
func (*ReportMock) MinimockCaptureMarkInspect ¶
func (m *ReportMock) MinimockCaptureMarkInspect()
MinimockCaptureMarkInspect logs each unmet expectation
func (*ReportMock) MinimockDetailsDone ¶
func (m *ReportMock) MinimockDetailsDone() bool
MinimockDetailsDone returns true if the count of the Details invocations corresponds the number of defined expectations
func (*ReportMock) MinimockDetailsInspect ¶
func (m *ReportMock) MinimockDetailsInspect()
MinimockDetailsInspect logs each unmet expectation
func (*ReportMock) MinimockFinish ¶
func (m *ReportMock) MinimockFinish()
MinimockFinish checks that all mocked methods have been called the expected number of times
func (*ReportMock) MinimockMisbehaviorTypeDone ¶
func (m *ReportMock) MinimockMisbehaviorTypeDone() bool
MinimockMisbehaviorTypeDone returns true if the count of the MisbehaviorType invocations corresponds the number of defined expectations
func (*ReportMock) MinimockMisbehaviorTypeInspect ¶
func (m *ReportMock) MinimockMisbehaviorTypeInspect()
MinimockMisbehaviorTypeInspect logs each unmet expectation
func (*ReportMock) MinimockViolatorHostDone ¶
func (m *ReportMock) MinimockViolatorHostDone() bool
MinimockViolatorHostDone returns true if the count of the ViolatorHost invocations corresponds the number of defined expectations
func (*ReportMock) MinimockViolatorHostInspect ¶
func (m *ReportMock) MinimockViolatorHostInspect()
MinimockViolatorHostInspect logs each unmet expectation
func (*ReportMock) MinimockViolatorNodeDone ¶
func (m *ReportMock) MinimockViolatorNodeDone() bool
MinimockViolatorNodeDone returns true if the count of the ViolatorNode invocations corresponds the number of defined expectations
func (*ReportMock) MinimockViolatorNodeInspect ¶
func (m *ReportMock) MinimockViolatorNodeInspect()
MinimockViolatorNodeInspect logs each unmet expectation
func (*ReportMock) MinimockWait ¶
func (m *ReportMock) MinimockWait(timeout mm_time.Duration)
MinimockWait waits for all mocked methods to be called the expected number of times
func (*ReportMock) MisbehaviorType ¶
func (mmMisbehaviorType *ReportMock) MisbehaviorType() (t1 Type)
MisbehaviorType implements Report
func (*ReportMock) MisbehaviorTypeAfterCounter ¶
func (mmMisbehaviorType *ReportMock) MisbehaviorTypeAfterCounter() uint64
MisbehaviorTypeAfterCounter returns a count of finished ReportMock.MisbehaviorType invocations
func (*ReportMock) MisbehaviorTypeBeforeCounter ¶
func (mmMisbehaviorType *ReportMock) MisbehaviorTypeBeforeCounter() uint64
MisbehaviorTypeBeforeCounter returns a count of ReportMock.MisbehaviorType invocations
func (*ReportMock) ViolatorHost ¶
func (mmViolatorHost *ReportMock) ViolatorHost() (i1 endpoints.InboundConnection)
ViolatorHost implements Report
func (*ReportMock) ViolatorHostAfterCounter ¶
func (mmViolatorHost *ReportMock) ViolatorHostAfterCounter() uint64
ViolatorHostAfterCounter returns a count of finished ReportMock.ViolatorHost invocations
func (*ReportMock) ViolatorHostBeforeCounter ¶
func (mmViolatorHost *ReportMock) ViolatorHostBeforeCounter() uint64
ViolatorHostBeforeCounter returns a count of ReportMock.ViolatorHost invocations
func (*ReportMock) ViolatorNode ¶
func (mmViolatorNode *ReportMock) ViolatorNode() (b1 profiles.BaseNode)
ViolatorNode implements Report
func (*ReportMock) ViolatorNodeAfterCounter ¶
func (mmViolatorNode *ReportMock) ViolatorNodeAfterCounter() uint64
ViolatorNodeAfterCounter returns a count of finished ReportMock.ViolatorNode invocations
func (*ReportMock) ViolatorNodeBeforeCounter ¶
func (mmViolatorNode *ReportMock) ViolatorNodeBeforeCounter() uint64
ViolatorNodeBeforeCounter returns a count of ReportMock.ViolatorNode invocations
type ReportMockCaptureMarkExpectation ¶
type ReportMockCaptureMarkExpectation struct { Counter uint64 // contains filtered or unexported fields }
ReportMockCaptureMarkExpectation specifies expectation struct of the Report.CaptureMark
type ReportMockCaptureMarkResults ¶
type ReportMockCaptureMarkResults struct {
// contains filtered or unexported fields
}
ReportMockCaptureMarkResults contains results of the Report.CaptureMark
type ReportMockDetailsExpectation ¶
type ReportMockDetailsExpectation struct { Counter uint64 // contains filtered or unexported fields }
ReportMockDetailsExpectation specifies expectation struct of the Report.Details
type ReportMockDetailsResults ¶
type ReportMockDetailsResults struct {
// contains filtered or unexported fields
}
ReportMockDetailsResults contains results of the Report.Details
type ReportMockMisbehaviorTypeExpectation ¶
type ReportMockMisbehaviorTypeExpectation struct { Counter uint64 // contains filtered or unexported fields }
ReportMockMisbehaviorTypeExpectation specifies expectation struct of the Report.MisbehaviorType
type ReportMockMisbehaviorTypeResults ¶
type ReportMockMisbehaviorTypeResults struct {
// contains filtered or unexported fields
}
ReportMockMisbehaviorTypeResults contains results of the Report.MisbehaviorType
type ReportMockViolatorHostExpectation ¶
type ReportMockViolatorHostExpectation struct { Counter uint64 // contains filtered or unexported fields }
ReportMockViolatorHostExpectation specifies expectation struct of the Report.ViolatorHost
type ReportMockViolatorHostResults ¶
type ReportMockViolatorHostResults struct {
// contains filtered or unexported fields
}
ReportMockViolatorHostResults contains results of the Report.ViolatorHost
type ReportMockViolatorNodeExpectation ¶
type ReportMockViolatorNodeExpectation struct { Counter uint64 // contains filtered or unexported fields }
ReportMockViolatorNodeExpectation specifies expectation struct of the Report.ViolatorNode
type ReportMockViolatorNodeResults ¶
type ReportMockViolatorNodeResults struct {
// contains filtered or unexported fields
}
ReportMockViolatorNodeResults contains results of the Report.ViolatorNode