gossip

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChannelExist    = errors.New("channel already exists")
	ErrChannelNotExist = errors.New("channel does not exist")
)

Portable analogs of some common channel call errors

Functions

This section is empty.

Types

type Gossip

type Gossip interface {
	// SelfPKIid returns the peer's PKI-ID
	SelfPKIid() common.PKIidType

	// SelfChainInfo returns the peer's latest ChainState message of a given channel
	SelfChainInfo(chainID string) *protos.ChainState

	// AddMemberToChain adds member to channel
	AddMemberToChain(chainMac common.ChainMac, member common.PKIidType) (*protos.ChainState, error)

	// RemoveMemberWithChain removes member contained in the channel
	RemoveMemberWithChain(chainMac common.ChainMac, member common.PKIidType) (*protos.ChainState, error)

	// AddFileToChain adds file to channel
	AddFileToChain(chainMac common.ChainMac, files []*common.FileSyncInfo) (*protos.ChainState, error)

	// RemoveFileWithChain removes file contained in the channel
	RemoveFileWithChain(chainMac common.ChainMac, filenames []string) (*protos.ChainState, error)

	// GetPKIidOfCert returns the PKI-ID of a certificate
	GetPKIidOfCert(nodeID string, cert *x509.Certificate) (common.PKIidType, error)

	// InitializeChain initialize channel
	InitializeChain(chainMac common.ChainMac, chainState *protos.ChainState) error

	// CreateChain creates a channel
	CreateChain(chainMac common.ChainMac, chainID string, files []*common.FileSyncInfo) (*protos.ChainState, error)

	// CloseChain closes a channel
	CloseChain(chainMac common.ChainMac, notify bool) error

	// CreateLeaveChainMessage creates LeaveChainMessage for channel
	CreateLeaveChainMessage(chainMac common.ChainMac) (*protos.SignedRKSyncMessage, error)

	// GetPeers returns the NetworkMembers considered alive
	Peers() []common.NetworkMember

	// Accept returns a dedicated read-only channel for messages sent by other nodes that match a certain predicate.
	Accept(acceptor common.MessageAcceptor, mac []byte, passThrough bool) (<-chan *protos.RKSyncMessage, <-chan protos.ReceivedMessage)

	// Stop the gossip component
	Stop()
}

Gossip is the interface of the gossip component

func NewGossipService

func NewGossipService(gConf *config.GossipConfig, idConf *config.IdentityConfig, s *grpc.Server,
	selfIdentity common.PeerIdentityType, secureDialOpts func() []grpc.DialOption) (Gossip, error)

NewGossipService creates a gossip instance attached to a gRPC server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL