Documentation ¶
Index ¶
Constants ¶
View Source
const ( PeerCreated string = "peer_created" PeerUpdated string = "peer_updated" PeerDeleted string = "peer_deleted" )
Variables ¶
View Source
var (
ErrPeerNotFound = errors.New("peer not found")
)
Functions ¶
func MockedMesh ¶
func MockedMesh() *mockedMesh
func NewPeerStore ¶
func NewPeerStore(mesh types.GossipServiceLayer) (*memDBStore, error)
Types ¶
type PeerStore ¶
type PeerStore interface { ByID(id string) (Peer, error) ByService(name string) (SubscriptionSet, error) EndpointsByService(name string) ([]*pb.NodeService, error) All() (SubscriptionSet, error) Exists(id string) bool Upsert(p Peer) error Update(id string, mutation func(peer Peer) Peer) error Delete(id string) error On(event string, handler func(Peer)) func() }
type SubscriptionSet ¶
type SubscriptionSet []Peer
func (SubscriptionSet) Apply ¶
func (set SubscriptionSet) Apply(f func(s Peer))
func (SubscriptionSet) ApplyIdx ¶
func (set SubscriptionSet) ApplyIdx(f func(idx int, s Peer))
func (SubscriptionSet) Filter ¶
func (set SubscriptionSet) Filter(filters ...peerFilter) SubscriptionSet
Click to show internal directories.
Click to hide internal directories.