Documentation ¶
Index ¶
Constants ¶
View Source
const ( EvilScoreTableDialFail uint16 = 40 EvilScoreTableReducePerMinute uint16 = 1 )
evilScoreTable
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnList ¶
type ConnList struct {
// contains filtered or unexported fields
}
ConnList stores information for peers even connected at least once.
func NewConnList ¶
NewConnList is creator of physical Connection list
func (*ConnList) Get ¶
func (pl *ConnList) Get(addr string) (p ConnectionInfo, err error)
Get is returned strored ConnectionInfo
func (*ConnList) Store ¶
func (pl *ConnList) Store(v ConnectionInfo) error
Store is strore the ConnectionInfo
type ConnectionInfo ¶
ConnectionInfo is struct for manage evel scroe
type KindOfEvil ¶
type KindOfEvil uint16
KindOfEvil is define evil table type
const (
BadBehaviour KindOfEvil = 40
)
evilnode evil score table
type Manager ¶
type Manager struct { Config *Config List *ConnList NoticeList map[string]NoticeEvil }
Manager is node evil score manager
func (*Manager) IsBanNode ¶
IsBanNode is return true value when the target node over the base evil score
func (*Manager) RegisterNoticeEvilNode ¶
func (r *Manager) RegisterNoticeEvilNode(ne NoticeEvil)
RegisterNoticeEvilNode is Registered notice EvilNode
type NoticeEvil ¶
type NoticeEvil interface {
NewEvilNode(string)
}
NoticeEvil is interface for notifies the registered object when the evil node appears.
Click to show internal directories.
Click to hide internal directories.