Documentation ¶
Index ¶
- Constants
- func Contains(s string, arr []string) bool
- func CreateGRPCLayer() (port int, gRPCServer *comm.GRPCServer, certs *common.TLSCertificates, ...)
- func GenerateTLSCertificatesOrPanic() tls.Certificate
- func GetLogger(model string, endpoint string) *hlogging.HyperchainLogger
- func GetRandomIndices(indiceCount, highestIndex int) []int
- func IndexInSlice(array interface{}, o interface{}, equals Equals) int
- func RandomIntn(n int) int
- func RandomUint64() uint64
- type Equals
- type MembershipStore
- func (ms *MembershipStore) MsgByID(pkiID common.PKIid) *protoext.SignedGossipMessage
- func (ms *MembershipStore) Put(pkiID common.PKIid, msg *protoext.SignedGossipMessage)
- func (ms *MembershipStore) Remove(pkiID common.PKIid)
- func (ms *MembershipStore) Size() int
- func (ms *MembershipStore) ToSlice() []*protoext.SignedGossipMessage
- type PubSub
- type Set
- type Subscription
Constants ¶
View Source
const ( DiscoveryLogger = "gossip.discovery" ElectionLogger = "gossip.election" CommLogger = "gossip.comm" ConnLogger = "gossip.comm.conn" )
Variables ¶
This section is empty.
Functions ¶
func CreateGRPCLayer ¶
func CreateGRPCLayer() (port int, gRPCServer *comm.GRPCServer, certs *common.TLSCertificates, secureDialOpts api.PeerSecureDialOpts, dialOpts []grpc.DialOption)
func GenerateTLSCertificatesOrPanic ¶
func GenerateTLSCertificatesOrPanic() tls.Certificate
func GetRandomIndices ¶
GetRandomIndices 将 [0,highestIndex] 区间内的所有数字打乱,然后取前 indiceCount 个数字返回。
func IndexInSlice ¶
func RandomIntn ¶
func RandomUint64 ¶
func RandomUint64() uint64
Types ¶
type MembershipStore ¶
type MembershipStore struct {
// contains filtered or unexported fields
}
MembershipStore 结构体中定义了一个字段:map[string]*protoext.SignedGossipMessage,PKI-ID => *protoext.SignedGossipMessage, 用于存储哪个 peer 节点产生了什么 *protoext.SignedGossipMessage。
func NewMembershipStore ¶
func NewMembershipStore() *MembershipStore
func (*MembershipStore) MsgByID ¶
func (ms *MembershipStore) MsgByID(pkiID common.PKIid) *protoext.SignedGossipMessage
MsgByID 根据给定的 PKI-ID,返回 MembershipStore 中存储的 *protoext.SignedGossipMessage。
func (*MembershipStore) Put ¶
func (ms *MembershipStore) Put(pkiID common.PKIid, msg *protoext.SignedGossipMessage)
func (*MembershipStore) Remove ¶
func (ms *MembershipStore) Remove(pkiID common.PKIid)
func (*MembershipStore) ToSlice ¶
func (ms *MembershipStore) ToSlice() []*protoext.SignedGossipMessage
type Subscription ¶
type Subscription interface {
Listen() (interface{}, error)
}
Click to show internal directories.
Click to hide internal directories.