Documentation ¶
Index ¶
- Constants
- func BytesToStrings(bytes [][]byte) []string
- func Contains(s string, a []string) bool
- func CreateGRPCLayer() (port int, gRPCServer *comm.GRPCServer, certs *common.TLSCertificates, ...)
- func GetDurationOrDefault(key string, defVal time.Duration) time.Duration
- func GetFloat64OrDefault(key string, defVal float64) float64
- func GetIntOrDefault(key string, defVal int) int
- func GetRandomIndices(indiceCount, highestIndex int) []int
- func IndexInSlice(array interface{}, o interface{}, equals Equals) int
- func PrintStackTrace()
- func PrivateRWSets(rwsets ...PrivateRWSet) [][]byte
- func RandomInt(n int) int
- func RandomUInt64() uint64
- func SetVal(key string, val interface{})
- func SetupTestLogging()
- func StringsToBytes(strings []string) [][]byte
- type Equals
- type Logger
- type MembershipStore
- func (m *MembershipStore) MsgByID(pkiID common.PKIidType) *protoext.SignedGossipMessage
- func (m *MembershipStore) Put(pkiID common.PKIidType, msg *protoext.SignedGossipMessage)
- func (m *MembershipStore) Remove(pkiID common.PKIidType)
- func (m *MembershipStore) Size() int
- func (m *MembershipStore) ToSlice() []*protoext.SignedGossipMessage
- type PrivateRWSet
- type PrivateRWSetWithConfig
- type PubSub
- type PvtDataCollections
- type Set
- type Subscription
Constants ¶
const ( ChannelLogger = "gossip.channel" CommLogger = "gossip.comm" DiscoveryLogger = "gossip.discovery" ElectionLogger = "gossip.election" GossipLogger = "gossip.gossip" CommMockLogger = "gossip.comm.mock" PullLogger = "gossip.pull" ServiceLogger = "gossip.service" StateLogger = "gossip.state" PrivateDataLogger = "gossip.privdata" )
Logger names for logger initialization.
Variables ¶
This section is empty.
Functions ¶
func BytesToStrings ¶ added in v1.3.0
func CreateGRPCLayer ¶ added in v1.4.1
func CreateGRPCLayer() (port int, gRPCServer *comm.GRPCServer, certs *common.TLSCertificates, secureDialOpts api.PeerSecureDialOpts, dialOpts []grpc.DialOption)
CreateGRPCLayer returns a new gRPC server with associated port, TLS certificates, SecureDialOpts and DialOption
func GetDurationOrDefault ¶
GetDurationOrDefault returns the Duration value from config if present otherwise default value
func GetFloat64OrDefault ¶ added in v1.2.0
GetFloat64OrDefault returns the float64 value from config if present otherwise default value
func GetIntOrDefault ¶
GetIntOrDefault returns the int value from config if present otherwise default value
func GetRandomIndices ¶
GetRandomIndices returns a slice of random indices from 0 to given highestIndex
func IndexInSlice ¶
IndexInSlice returns the index of given object o in array
func PrivateRWSets ¶ added in v1.1.0
func PrivateRWSets(rwsets ...PrivateRWSet) [][]byte
PrivateRWSets creates an aggregated slice of RWSets
func RandomInt ¶
RandomInt returns, as an int, a non-negative pseudo-random integer in [0,n) It panics if n <= 0
func SetVal ¶ added in v1.4.0
func SetVal(key string, val interface{})
SetVal stores key value to viper
func SetupTestLogging ¶
func SetupTestLogging()
SetupTestLogging sets the default log levels for gossip unit tests
func StringsToBytes ¶ added in v1.3.0
Types ¶
type Equals ¶
type Equals func(a interface{}, b interface{}) bool
Equals returns whether a and b are the same
type Logger ¶ added in v1.3.0
type Logger interface { Debug(args ...interface{}) Debugf(format string, args ...interface{}) Error(args ...interface{}) Errorf(format string, args ...interface{}) Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) Info(args ...interface{}) Infof(format string, args ...interface{}) Panic(args ...interface{}) Panicf(format string, args ...interface{}) Warning(args ...interface{}) Warningf(format string, args ...interface{}) IsEnabledFor(l zapcore.Level) bool }
type MembershipStore ¶
MembershipStore struct which encapsulates membership message store abstraction
func NewMembershipStore ¶
func NewMembershipStore() *MembershipStore
NewMembershipStore creates new membership store instance
func (*MembershipStore) MsgByID ¶
func (m *MembershipStore) MsgByID(pkiID common.PKIidType) *protoext.SignedGossipMessage
MsgByID returns a message stored by a certain ID, or nil if such an ID isn't found
func (*MembershipStore) Put ¶
func (m *MembershipStore) Put(pkiID common.PKIidType, msg *protoext.SignedGossipMessage)
Put associates msg with the given pkiID
func (*MembershipStore) Remove ¶
func (m *MembershipStore) Remove(pkiID common.PKIidType)
Remove removes a message with a given pkiID
func (*MembershipStore) ToSlice ¶
func (m *MembershipStore) ToSlice() []*protoext.SignedGossipMessage
ToSlice returns a slice backed by the elements of the MembershipStore
type PrivateRWSet ¶ added in v1.1.0
type PrivateRWSet []byte
PrivateRWSet contains the bytes of CollectionPvtReadWriteSet
func (PrivateRWSet) Digest ¶ added in v1.1.0
func (rws PrivateRWSet) Digest() string
Digest returns a deterministic and collision-free representation of the PrivateRWSet
type PrivateRWSetWithConfig ¶ added in v1.2.0
type PrivateRWSetWithConfig struct { RWSet []PrivateRWSet CollectionConfig *common.CollectionConfig }
PrivateRWSetWithConfig encapsulates private read-write set among with relevant to collections config information
type PubSub ¶
PubSub defines a struct that one can use to: - publish items to a topic to multiple subscribers - and subscribe to items from a topic The subscriptions have a TTL and are cleaned when it passes.
func NewPubSub ¶
func NewPubSub() *PubSub
NewPubSub creates a new PubSub with an empty set of subscriptions
type PvtDataCollections ¶ added in v1.1.0
PvtDataCollections data type to encapsulate collections of private data
func (*PvtDataCollections) Marshal ¶ added in v1.1.0
func (pvt *PvtDataCollections) Marshal() ([][]byte, error)
Marshal encodes private collection into bytes array
func (*PvtDataCollections) Unmarshal ¶ added in v1.1.0
func (pvt *PvtDataCollections) Unmarshal(data [][]byte) error
Unmarshal read and unmarshal collection of private data from given bytes array
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is a generic and thread-safe set container
type Subscription ¶
type Subscription interface { // Listen blocks until a publish was made // to the subscription, or an error if the // subscription's TTL passed Listen() (interface{}, error) }
Subscription defines a subscription to a topic that can be used to receive publishes on