Documentation ¶
Index ¶
- Constants
- Variables
- func ChannelOfNetID(id int) string
- func Inspect(c module.Chain, informal bool) map[string]interface{}
- func NewManager(c module.Chain, nt module.NetworkTransport, trustSeeds string, ...) module.NetworkManager
- func NewPeerID(b []byte) module.PeerID
- func NewPeerIDFromAddress(a module.Address) module.PeerID
- func NewPeerIDFromPublicKey(k *crypto.PublicKey) module.PeerID
- func NewTransport(address string, w module.Wallet, l log.Logger) module.NetworkTransport
- type Authenticator
- func (a *Authenticator) GetSecureAeads(channel string) []SecureAeadSuite
- func (a *Authenticator) GetSecureSuites(channel string) []SecureSuite
- func (a *Authenticator) SetSecureAeads(channel string, sas []SecureAeadSuite) error
- func (a *Authenticator) SetSecureSuites(channel string, ss []SecureSuite) error
- func (a *Authenticator) Signature(content []byte) []byte
- func (a *Authenticator) VerifySignature(publicKey []byte, signature []byte, content []byte) (module.PeerID, error)
- type BytesSet
- type ChannelNegotiator
- type ChannelQueue
- type Counter
- type Dialer
- type Error
- type JoinRequest
- type JoinResponse
- type Listener
- type NetAddress
- type NetAddressSet
- func (s *NetAddressSet) Add(a NetAddress) bool
- func (s *NetAddressSet) Array() []NetAddress
- func (s *NetAddressSet) Clear()
- func (s *NetAddressSet) ClearAndAdd(args ...NetAddress)
- func (s *NetAddressSet) Contains(a NetAddress) bool
- func (s *NetAddressSet) ContainsWithData(a NetAddress, d string) bool
- func (s *NetAddressSet) Data(a NetAddress) (string, bool)
- func (s *NetAddressSet) Map() map[NetAddress]string
- func (s *NetAddressSet) Merge(args ...NetAddress)
- func (s *NetAddressSet) RemoveData(a NetAddress) string
- func (s *NetAddressSet) SetAndRemoveByData(a NetAddress, d string) (old string, removed NetAddress)
- type P2PConnectionRequest
- type P2PConnectionResponse
- type Packet
- type PacketPool
- type PacketReader
- type PacketWriter
- type Peer
- func (p *Peer) Channel() string
- func (p *Peer) Close(reason string) error
- func (p *Peer) CloseByError(err error) error
- func (p *Peer) CloseInfo() string
- func (p *Peer) ConnString() string
- func (p *Peer) ConnType() PeerConnectionType
- func (p *Peer) DialNetAddress() NetAddress
- func (p *Peer) EqualsAttr(k string, v interface{}) bool
- func (p *Peer) EqualsRole(r PeerRoleFlag) bool
- func (p *Peer) GetAndHandleAttr(k string, h func(v interface{}, exists bool) bool) (interface{}, bool)
- func (p *Peer) GetAttr(k string) (interface{}, bool)
- func (p *Peer) HasCloseError(err error) bool
- func (p *Peer) HasRecvRole(r PeerRoleFlag) bool
- func (p *Peer) HasRole(r PeerRoleFlag) bool
- func (p *Peer) ID() module.PeerID
- func (p *Peer) In() bool
- func (p *Peer) IsClosed() bool
- func (p *Peer) NetAddress() NetAddress
- func (p *Peer) ProtocolInfos() *ProtocolInfos
- func (p *Peer) PutAttr(k string, v interface{})
- func (p *Peer) RecvConnType() PeerConnectionType
- func (p *Peer) RecvRole() PeerRoleFlag
- func (p *Peer) RemoveAttr(k string)
- func (p *Peer) ResetConn(conn net.Conn)
- func (p *Peer) Role() PeerRoleFlag
- func (p *Peer) String() string
- func (p *Peer) WaitClose()
- type PeerConnectionType
- type PeerDispatcher
- type PeerHandler
- type PeerIDSet
- func (s *PeerIDSet) Add(id module.PeerID) (r bool)
- func (s *PeerIDSet) Array() []module.PeerID
- func (s *PeerIDSet) Bytes() []byte
- func (s *PeerIDSet) ClearAndAdd(args ...module.PeerID)
- func (s *PeerIDSet) Contains(id module.PeerID) bool
- func (s *PeerIDSet) Merge(args ...module.PeerID)
- func (s *PeerIDSet) Remove(id module.PeerID) (r bool)
- func (s *PeerIDSet) Removes(args ...module.PeerID)
- type PeerPredicate
- type PeerRTT
- func (r *PeerRTT) Avg(d time.Duration) float64
- func (r *PeerRTT) Last(d time.Duration) float64
- func (r *PeerRTT) Start()
- func (r *PeerRTT) StartWithAfterFunc(to time.Duration, f func())
- func (r *PeerRTT) Stop() time.Duration
- func (r *PeerRTT) String() string
- func (r *PeerRTT) Value() (time.Duration, time.Duration)
- type PeerRoleFlag
- type PeerSet
- func (s *PeerSet) Add(p *Peer) bool
- func (s *PeerSet) AddWithPredicate(p *Peer, f PeerPredicate) bool
- func (s *PeerSet) Array() []*Peer
- func (s *PeerSet) Clear()
- func (s *PeerSet) Contains(p *Peer) bool
- func (s *PeerSet) Find(f func(p *Peer) bool) []*Peer
- func (s *PeerSet) FindOne(f PeerPredicate) *Peer
- func (s *PeerSet) GetBy(role PeerRoleFlag, has bool, in bool) []*Peer
- func (s *PeerSet) GetByID(id module.PeerID) *Peer
- func (s *PeerSet) GetByProtocol(pi module.ProtocolInfo) []*Peer
- func (s *PeerSet) GetByRole(r PeerRoleFlag, has bool) []*Peer
- func (s *PeerSet) HasNetAddress(a NetAddress) bool
- func (s *PeerSet) IsEmpty() bool
- func (s *PeerSet) Len() int
- func (s *PeerSet) LenByProtocol(pi module.ProtocolInfo) int
- func (s *PeerSet) Merge(args ...*Peer)
- func (s *PeerSet) NetAddresses() []NetAddress
- func (s *PeerSet) Remove(p *Peer) bool
- type PeerToPeer
- func (p2p *PeerToPeer) EqualsRole(r PeerRoleFlag) bool
- func (p2p *PeerToPeer) HasRole(r PeerRoleFlag) bool
- func (p2p *PeerToPeer) ID() module.PeerID
- func (p2p *PeerToPeer) IsStarted() bool
- func (p2p *PeerToPeer) NetAddress() NetAddress
- func (p2p *PeerToPeer) Role() PeerRoleFlag
- func (p2p *PeerToPeer) Send(pkt *Packet) error
- func (p2p *PeerToPeer) Start()
- func (p2p *PeerToPeer) Stop()
- type PriorityQueue
- type ProtocolInfos
- func (pis *ProtocolInfos) Add(pi module.ProtocolInfo)
- func (pis *ProtocolInfos) Array() []module.ProtocolInfo
- func (pis *ProtocolInfos) Exists(pi module.ProtocolInfo) bool
- func (pis *ProtocolInfos) ExistsByID(piList ...module.ProtocolInfo) bool
- func (pis *ProtocolInfos) Len() int
- func (pis *ProtocolInfos) LenOfIDSet() int
- func (pis *ProtocolInfos) Remove(pi module.ProtocolInfo)
- func (pis *ProtocolInfos) Resolve(target *ProtocolInfos)
- func (pis *ProtocolInfos) Set(piList []module.ProtocolInfo)
- type QueryMessage
- type QueryResultMessage
- type Queue
- type RttMessage
- type SecureAead
- type SecureAeadSuite
- type SecureConn
- type SecureError
- type SecureRequest
- type SecureResponse
- type SecureSuite
- type Set
- func (s *Set) Add(v interface{}) bool
- func (s *Set) Array() interface{}
- func (s *Set) Clear()
- func (s *Set) Contains(v interface{}) bool
- func (s *Set) IsEmpty() bool
- func (s *Set) Len() int
- func (s *Set) Map() map[interface{}]interface{}
- func (s *Set) Merge(args ...interface{})
- func (s *Set) Remove(v interface{}) bool
- func (s *Set) Set(v interface{}, d interface{}) interface{}
- func (s *Set) String() string
- type SignatureRequest
- type SignatureResponse
- type TimestampPool
- type WeightQueue
Constants ¶
View Source
const ( AlreadyListenedError = errors.CodeNetwork + iota AlreadyClosedError AlreadyDialingError AlreadyRegisteredReactorError AlreadyRegisteredProtocolError NotRegisteredReactorError NotRegisteredProtocolError NotRegisteredRoleError NotAuthorizedError NotAvailableError NotStartedError QueueOverflowError DuplicatedPacketError DuplicatedPeerError InvalidMessageSequenceError InvalidSignatureError )
View Source
const ( DefaultTransportNet = "tcp4" DefaultDialTimeout = 5 * time.Second DefaultReceiveQueueSize = 4096 DefaultPacketBufferSize = 4096 //bufio.defaultBufSize=4096 DefaultPacketPayloadMax = 1024 * 1024 DefaultPacketPoolNumBucket = 20 DefaultPacketPoolBucketLen = 500 DefaultDiscoveryPeriod = 2 * time.Second DefaultSeedPeriod = 3 * time.Second DefaultAlternateSendPeriod = 1 * time.Second DefaultSendTimeout = 5 * time.Second DefaultSendQueueMaxPriority = 7 DefaultSendQueueSize = 1000 DefaultEventQueueSize = 100 DefaultPeerSendQueueSize = 1000 DefaultPeerPoolExpireSecond = 5 DefaultParentsLimit = 1 DefaultUnclesLimit = 1 DefaultChildrenLimit = 10 DefaultNephewsLimit = 10 DefaultOthersLimit = 10 DefaultPacketRewriteLimit = 10 DefaultPacketRewriteDelay = 100 * time.Millisecond DefaultRttAccuracy = 10 * time.Millisecond DefaultRttLogTimeout = 1 * time.Second DefaultRttLogThreshold = 1 * time.Second DefaultFailureNodeMin = 2 DefaultSelectiveFloodingAdd = 1 DefaultSimplePeerIDSize = 4 DefaultDuplicatedPeerTime = 1 * time.Second DefaultMaxRetryClose = 10 AttrP2PConnectionRequest = "P2PConnectionRequest" AttrP2PLegacy = "P2PLegacy" AttrSupportDefaultProtocols = "SupportDefaultProtocols" DefaultQueryElementLength = 200 )
View Source
const ( SecureSuiteUnknown = iota SecureSuiteNone SecureSuiteTls SecureSuiteEcdhe )
View Source
const ( SecureAeadSuiteNone = iota SecureAeadSuiteChaCha20Poly1305 SecureAeadSuiteAes128Gcm SecureAeadSuiteAes256Gcm )
View Source
const ( SecureErrorNone = "" SecureErrorInvalid = "invalid" )
View Source
const (
AttrWaitSubProtocolInfo = "waitSubProtocolInfo"
)
View Source
const (
LoggerFieldKeySubModule = "sub"
)
Variables ¶
View Source
var ( DefaultSecureEllipticCurve = elliptic.P256() DefaultSecureSuites = []SecureSuite{ SecureSuiteNone, SecureSuiteTls, SecureSuiteEcdhe, } DefaultSecureAeadSuites = []SecureAeadSuite{ SecureAeadSuiteChaCha20Poly1305, SecureAeadSuiteAes128Gcm, SecureAeadSuiteAes256Gcm, } DefaultSecureKeyLogWriter io.Writer )
View Source
var ( ErrAlreadyListened = errors.NewBase(AlreadyListenedError, "AlreadyListened") ErrAlreadyClosed = errors.NewBase(AlreadyClosedError, "AlreadyClosed") ErrAlreadyDialing = errors.NewBase(AlreadyDialingError, "AlreadyDialing") ErrAlreadyRegisteredReactor = errors.NewBase(AlreadyRegisteredReactorError, "AlreadyRegisteredReactor") ErrAlreadyRegisteredProtocol = errors.NewBase(AlreadyRegisteredProtocolError, "AlreadyRegisteredProtocol") ErrNotRegisteredReactor = errors.NewBase(NotRegisteredReactorError, "NotRegisteredReactor") ErrNotRegisteredProtocol = errors.NewBase(NotRegisteredProtocolError, "NotRegisteredProtocol") ErrNotRegisteredRole = errors.NewBase(NotRegisteredRoleError, "NotRegisteredRole") ErrNotAuthorized = errors.NewBase(NotAuthorizedError, "NotAuthorized") ErrNotAvailable = errors.NewBase(NotAvailableError, "NotAvailable") ErrNotStarted = errors.NewBase(NotStartedError, "NotStarted") ErrQueueOverflow = errors.NewBase(QueueOverflowError, "QueueOverflow") ErrDuplicatedPacket = errors.NewBase(DuplicatedPacketError, "DuplicatedPacket") ErrDuplicatedPeer = errors.NewBase(DuplicatedPeerError, "DuplicatedPeer") ErrInvalidMessageSequence = errors.NewBase(InvalidMessageSequenceError, "InvalidMessageSequence") ErrInvalidSignature = errors.NewBase(InvalidSignatureError, "InvalidSignatureError") ErrIllegalArgument = errors.ErrIllegalArgument )
View Source
var ErrInProgress = errors.NewBase(errors.UnknownError, "InProgressError")
Functions ¶
func ChannelOfNetID ¶
func NewManager ¶
func NewManager(c module.Chain, nt module.NetworkTransport, trustSeeds string, roles ...module.Role) module.NetworkManager
func NewTransport ¶
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func (*Authenticator) GetSecureAeads ¶
func (a *Authenticator) GetSecureAeads(channel string) []SecureAeadSuite
func (*Authenticator) GetSecureSuites ¶
func (a *Authenticator) GetSecureSuites(channel string) []SecureSuite
func (*Authenticator) SetSecureAeads ¶
func (a *Authenticator) SetSecureAeads(channel string, sas []SecureAeadSuite) error
func (*Authenticator) SetSecureSuites ¶
func (a *Authenticator) SetSecureSuites(channel string, ss []SecureSuite) error
func (*Authenticator) Signature ¶
func (a *Authenticator) Signature(content []byte) []byte
func (*Authenticator) VerifySignature ¶
type BytesSet ¶
type BytesSet struct { *Set // contains filtered or unexported fields }
func NewBytesSet ¶
type ChannelNegotiator ¶
type ChannelNegotiator struct {
// contains filtered or unexported fields
}
func (*ChannelNegotiator) ProtocolInfos ¶ added in v1.2.9
func (cn *ChannelNegotiator) ProtocolInfos(channel string) *ProtocolInfos
type ChannelQueue ¶
type ChannelQueue struct {
// contains filtered or unexported fields
}
func (*ChannelQueue) Pop ¶
func (q *ChannelQueue) Pop() context.Context
func (*ChannelQueue) Wait ¶
func (q *ChannelQueue) Wait() <-chan context.Context
type Error ¶
type JoinRequest ¶
type JoinRequest struct { Channel string Addr NetAddress Protocols []module.ProtocolInfo }
type JoinResponse ¶
type JoinResponse struct { Channel string Addr NetAddress Protocols []module.ProtocolInfo }
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func (*Listener) SetAddress ¶
type NetAddress ¶
type NetAddress string
func (NetAddress) Validate ¶ added in v0.9.1
func (na NetAddress) Validate() error
type NetAddressSet ¶
type NetAddressSet struct { *Set // contains filtered or unexported fields }
func NewNetAddressSet ¶
func NewNetAddressSet() *NetAddressSet
func (*NetAddressSet) Add ¶
func (s *NetAddressSet) Add(a NetAddress) bool
func (*NetAddressSet) Array ¶
func (s *NetAddressSet) Array() []NetAddress
func (*NetAddressSet) Clear ¶
func (s *NetAddressSet) Clear()
func (*NetAddressSet) ClearAndAdd ¶
func (s *NetAddressSet) ClearAndAdd(args ...NetAddress)
func (*NetAddressSet) Contains ¶
func (s *NetAddressSet) Contains(a NetAddress) bool
func (*NetAddressSet) ContainsWithData ¶ added in v1.0.0
func (s *NetAddressSet) ContainsWithData(a NetAddress, d string) bool
func (*NetAddressSet) Data ¶ added in v1.0.10
func (s *NetAddressSet) Data(a NetAddress) (string, bool)
func (*NetAddressSet) Map ¶
func (s *NetAddressSet) Map() map[NetAddress]string
func (*NetAddressSet) Merge ¶
func (s *NetAddressSet) Merge(args ...NetAddress)
func (*NetAddressSet) RemoveData ¶ added in v1.0.0
func (s *NetAddressSet) RemoveData(a NetAddress) string
func (*NetAddressSet) SetAndRemoveByData ¶ added in v1.0.0
func (s *NetAddressSet) SetAndRemoveByData(a NetAddress, d string) (old string, removed NetAddress)
type P2PConnectionRequest ¶
type P2PConnectionRequest struct {
ConnType PeerConnectionType
}
type P2PConnectionResponse ¶
type P2PConnectionResponse struct { ReqConnType PeerConnectionType ConnType PeerConnectionType }
type Packet ¶
type Packet struct {
// contains filtered or unexported fields
}
srcPeerId, castType, destInfo, TTL(0:unlimited)
func NewPacket ¶
func NewPacket(pi module.ProtocolInfo, spi module.ProtocolInfo, payload []byte) *Packet
type PacketPool ¶
type PacketPool struct {
// contains filtered or unexported fields
}
func NewPacketPool ¶
func NewPacketPool(numOfBucket uint8, lenOfBucket uint16) *PacketPool
func (*PacketPool) Clear ¶
func (p *PacketPool) Clear()
func (*PacketPool) Contains ¶
func (p *PacketPool) Contains(pkt *Packet) bool
func (*PacketPool) Put ¶
func (p *PacketPool) Put(pkt *Packet) bool
type PacketReader ¶
func NewPacketReader ¶
func NewPacketReader(rd io.Reader) *PacketReader
NewPacketReader returns a new PacketReader whose buffer has the default size.
func (*PacketReader) ReadPacket ¶
func (pr *PacketReader) ReadPacket() (pkt *Packet, e error)
func (*PacketReader) Reset ¶
func (pr *PacketReader) Reset(rd io.Reader)
type PacketWriter ¶
func NewPacketWriter ¶
func NewPacketWriter(w io.Writer) *PacketWriter
func (*PacketWriter) Flush ¶
func (pw *PacketWriter) Flush() error
func (*PacketWriter) Reset ¶
func (pw *PacketWriter) Reset(wr io.Writer)
func (*PacketWriter) WritePacket ¶
func (pw *PacketWriter) WritePacket(pkt *Packet) error
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
func (*Peer) CloseByError ¶
func (*Peer) ConnString ¶
func (*Peer) ConnType ¶ added in v1.0.10
func (p *Peer) ConnType() PeerConnectionType
func (*Peer) DialNetAddress ¶ added in v1.0.0
func (p *Peer) DialNetAddress() NetAddress
func (*Peer) EqualsAttr ¶ added in v1.0.9
func (*Peer) EqualsRole ¶ added in v1.0.10
func (p *Peer) EqualsRole(r PeerRoleFlag) bool
func (*Peer) GetAndHandleAttr ¶ added in v1.3.4
func (*Peer) HasCloseError ¶ added in v1.0.9
func (*Peer) HasRecvRole ¶ added in v1.0.10
func (p *Peer) HasRecvRole(r PeerRoleFlag) bool
func (*Peer) HasRole ¶ added in v1.0.10
func (p *Peer) HasRole(r PeerRoleFlag) bool
func (*Peer) NetAddress ¶
func (p *Peer) NetAddress() NetAddress
func (*Peer) ProtocolInfos ¶ added in v1.2.9
func (p *Peer) ProtocolInfos() *ProtocolInfos
func (*Peer) RecvConnType ¶ added in v1.0.10
func (p *Peer) RecvConnType() PeerConnectionType
func (*Peer) RecvRole ¶ added in v1.0.10
func (p *Peer) RecvRole() PeerRoleFlag
func (*Peer) RemoveAttr ¶ added in v1.0.9
func (*Peer) Role ¶ added in v1.0.10
func (p *Peer) Role() PeerRoleFlag
type PeerConnectionType ¶
type PeerConnectionType byte
type PeerDispatcher ¶
type PeerDispatcher struct {
// contains filtered or unexported fields
}
type PeerHandler ¶
type PeerHandler interface {
// contains filtered or unexported methods
}
type PeerIDSet ¶
type PeerIDSet struct { *Set // contains filtered or unexported fields }
func NewPeerIDSet ¶
func NewPeerIDSet() *PeerIDSet
func NewPeerIDSetFromBytes ¶
func (*PeerIDSet) ClearAndAdd ¶
type PeerPredicate ¶ added in v0.9.2
type PeerRTT ¶
type PeerRTT struct {
// contains filtered or unexported fields
}
func NewPeerRTT ¶
func NewPeerRTT() *PeerRTT
func (*PeerRTT) StartWithAfterFunc ¶ added in v1.0.9
type PeerRoleFlag ¶
type PeerRoleFlag byte
PeerRoleFlag as BitFlag MSB[_,_,_,_,_,_,Root,Seed]LSB
func NewPeerRoleFlag ¶ added in v1.3.4
func NewPeerRoleFlag(roles ...module.Role) PeerRoleFlag
func (PeerRoleFlag) Has ¶
func (pr PeerRoleFlag) Has(o PeerRoleFlag) bool
func (*PeerRoleFlag) SetFlag ¶
func (pr *PeerRoleFlag) SetFlag(o PeerRoleFlag)
func (*PeerRoleFlag) ToRoles ¶
func (pr *PeerRoleFlag) ToRoles() []module.Role
func (*PeerRoleFlag) UnSetFlag ¶
func (pr *PeerRoleFlag) UnSetFlag(o PeerRoleFlag)
type PeerSet ¶
type PeerSet struct {
// contains filtered or unexported fields
}
func NewPeerSet ¶
func NewPeerSet() *PeerSet
func (*PeerSet) AddWithPredicate ¶ added in v0.9.2
func (s *PeerSet) AddWithPredicate(p *Peer, f PeerPredicate) bool
func (*PeerSet) FindOne ¶ added in v1.3.4
func (s *PeerSet) FindOne(f PeerPredicate) *Peer
func (*PeerSet) GetByProtocol ¶ added in v1.2.11
func (s *PeerSet) GetByProtocol(pi module.ProtocolInfo) []*Peer
func (*PeerSet) HasNetAddress ¶ added in v1.0.0
func (s *PeerSet) HasNetAddress(a NetAddress) bool
func (*PeerSet) LenByProtocol ¶ added in v1.2.11
func (s *PeerSet) LenByProtocol(pi module.ProtocolInfo) int
func (*PeerSet) NetAddresses ¶
func (s *PeerSet) NetAddresses() []NetAddress
type PeerToPeer ¶
type PeerToPeer struct {
// contains filtered or unexported fields
}
func (*PeerToPeer) EqualsRole ¶ added in v1.0.10
func (p2p *PeerToPeer) EqualsRole(r PeerRoleFlag) bool
func (*PeerToPeer) HasRole ¶ added in v1.0.10
func (p2p *PeerToPeer) HasRole(r PeerRoleFlag) bool
func (*PeerToPeer) ID ¶ added in v1.0.10
func (p2p *PeerToPeer) ID() module.PeerID
func (*PeerToPeer) IsStarted ¶
func (p2p *PeerToPeer) IsStarted() bool
func (*PeerToPeer) NetAddress ¶ added in v1.0.10
func (p2p *PeerToPeer) NetAddress() NetAddress
func (*PeerToPeer) Role ¶ added in v1.0.10
func (p2p *PeerToPeer) Role() PeerRoleFlag
func (*PeerToPeer) Send ¶
func (p2p *PeerToPeer) Send(pkt *Packet) error
func (*PeerToPeer) Start ¶
func (p2p *PeerToPeer) Start()
func (*PeerToPeer) Stop ¶
func (p2p *PeerToPeer) Stop()
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
func NewPriorityQueue ¶
func NewPriorityQueue(size int, maxPriority int) *PriorityQueue
func (*PriorityQueue) Close ¶
func (q *PriorityQueue) Close()
type ProtocolInfos ¶ added in v1.2.9
type ProtocolInfos struct {
// contains filtered or unexported fields
}
func (*ProtocolInfos) Add ¶ added in v1.2.9
func (pis *ProtocolInfos) Add(pi module.ProtocolInfo)
func (*ProtocolInfos) Array ¶ added in v1.2.9
func (pis *ProtocolInfos) Array() []module.ProtocolInfo
func (*ProtocolInfos) Exists ¶ added in v1.2.9
func (pis *ProtocolInfos) Exists(pi module.ProtocolInfo) bool
func (*ProtocolInfos) ExistsByID ¶ added in v1.2.11
func (pis *ProtocolInfos) ExistsByID(piList ...module.ProtocolInfo) bool
func (*ProtocolInfos) Len ¶ added in v1.2.9
func (pis *ProtocolInfos) Len() int
func (*ProtocolInfos) LenOfIDSet ¶ added in v1.2.9
func (pis *ProtocolInfos) LenOfIDSet() int
func (*ProtocolInfos) Remove ¶ added in v1.2.9
func (pis *ProtocolInfos) Remove(pi module.ProtocolInfo)
func (*ProtocolInfos) Resolve ¶ added in v1.2.9
func (pis *ProtocolInfos) Resolve(target *ProtocolInfos)
func (*ProtocolInfos) Set ¶ added in v1.2.9
func (pis *ProtocolInfos) Set(piList []module.ProtocolInfo)
type QueryMessage ¶
type QueryMessage struct {
Role PeerRoleFlag
}
type QueryResultMessage ¶
type QueryResultMessage struct { Role PeerRoleFlag Seeds []NetAddress Roots []NetAddress Children []NetAddress Nephews []NetAddress Message string }
type Queue ¶
type SecureAead ¶
type SecureAead struct {
// contains filtered or unexported fields
}
type SecureAeadSuite ¶
type SecureAeadSuite byte
func SecureAeadSuiteFromString ¶
func SecureAeadSuiteFromString(s string) SecureAeadSuite
func (SecureAeadSuite) String ¶
func (s SecureAeadSuite) String() string
type SecureConn ¶
func NewSecureConn ¶
func NewSecureConn(conn net.Conn, sa SecureAeadSuite, k *secureKey) (*SecureConn, error)
type SecureError ¶
type SecureError string
type SecureRequest ¶
type SecureRequest struct { Channel string SecureSuites []SecureSuite SecureAeadSuites []SecureAeadSuite SecureParam []byte }
type SecureResponse ¶
type SecureResponse struct { Channel string SecureSuite SecureSuite SecureAeadSuite SecureAeadSuite SecureParam []byte SecureError SecureError }
type SecureSuite ¶
type SecureSuite byte
func SecureSuiteFromString ¶
func SecureSuiteFromString(s string) SecureSuite
func (SecureSuite) String ¶
func (s SecureSuite) String() string
type SignatureRequest ¶
type SignatureResponse ¶
type TimestampPool ¶
type TimestampPool struct {
// contains filtered or unexported fields
}
func NewTimestampPool ¶
func NewTimestampPool(numOfBucket uint8) *TimestampPool
func (*TimestampPool) Clear ¶
func (p *TimestampPool) Clear()
func (*TimestampPool) Contains ¶
func (p *TimestampPool) Contains(k interface{}) bool
func (*TimestampPool) Put ¶
func (p *TimestampPool) Put(k interface{})
func (*TimestampPool) RemoveBefore ¶
func (p *TimestampPool) RemoveBefore(secondDuration int)
type WeightQueue ¶
type WeightQueue struct {
// contains filtered or unexported fields
}
func NewWeightQueue ¶
func NewWeightQueue(size int, nq int) *WeightQueue
func (*WeightQueue) Close ¶
func (q *WeightQueue) Close()
Click to show internal directories.
Click to hide internal directories.