gossip

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package gossip implements the createHistoryStream muxrpc call. Legacy (non-EBT) Replication of fetching and verifying the selected feeds is found here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFetcher

func NewFetcher(
	ctx context.Context,
	log logging.Interface,
	r repo.Interface,
	id refs.FeedRef,
	rxlog margaret.Log,
	userFeeds multilog.MultiLog,
	fm *FeedManager,
	wantList ssb.ReplicationLister,
	vr *message.VerificationRouter,
	opts ...interface{},
) *plugin

NewFetcher returns a muxrpc handler plugin which requests and verifies feeds, based on the passed replication lister.

func NewServer

func NewServer(
	ctx context.Context,
	log logging.Interface,
	id refs.FeedRef,
	rxlog margaret.Log,
	userFeeds multilog.MultiLog,
	wantList ssb.ReplicationLister,
	fm *FeedManager,
	opts ...interface{},
) histPlugin

NewServer just handles the "supplying" side of gossip replication.

Types

type FeedManager

type FeedManager struct {
	ReceiveLog margaret.Log
	UserFeeds  multilog.MultiLog
	// contains filtered or unexported fields
}

FeedManager handles serving gossip about User Feeds.

func NewFeedManager

func NewFeedManager(
	ctx context.Context,
	rxlog margaret.Log,
	userFeeds multilog.MultiLog,
	info logging.Interface,
	sysGauge metrics.Gauge,
	sysCtr metrics.Counter,
) *FeedManager

NewFeedManager returns a new FeedManager used for gossiping about User Feeds.

func (*FeedManager) CreateStreamHistory

func (m *FeedManager) CreateStreamHistory(
	ctx context.Context,
	sink *muxrpc.ByteSink,
	arg message.CreateHistArgs,
) error

CreateStreamHistory serves the sink a CreateStreamHistory request to the sink.

type HMACSecret

type HMACSecret *[32]byte

type IgnoreConnectHandler

type IgnoreConnectHandler struct{ muxrpc.Handler }

func (IgnoreConnectHandler) HandleConnect

func (IgnoreConnectHandler) HandleConnect(ctx context.Context, edp muxrpc.Endpoint)

type LegacyGossip

type LegacyGossip struct {
	Id         refs.FeedRef
	ReceiveLog margaret.Log
	UserFeeds  multilog.MultiLog
	WantList   ssb.ReplicationLister
	Info       logging.Interface
	// contains filtered or unexported fields
}

LegacyGossip implements incoming and outgoing createHistoryStream calls. Either register this plugin's HandleConnect for fetching feeds or the sbot.Negotiate plugin to get EBT opertunistlicly and fallback to this don't register both!

TODO: add feature flag for live streaming

func (*LegacyGossip) FetchAll

func (h *LegacyGossip) FetchAll(
	ctx context.Context,
	e muxrpc.Endpoint,
	set *ssb.StrFeedSet,
	withLive bool,
) error

func (*LegacyGossip) HandleCall

func (g *LegacyGossip) HandleCall(
	ctx context.Context,
	req *muxrpc.Request,
)

func (*LegacyGossip) HandleConnect

func (g *LegacyGossip) HandleConnect(ctx context.Context, e muxrpc.Endpoint)

HandleConnect on this handler triggers legacy createHistoryStream replication.

func (LegacyGossip) Handled

func (LegacyGossip) Handled(m muxrpc.Method) bool

func (*LegacyGossip) StartLegacyFetching

func (g *LegacyGossip) StartLegacyFetching(ctx context.Context, e muxrpc.Endpoint, withLive bool)

type Promisc

type Promisc bool

type WithLive

type WithLive bool

Jump to

Keyboard shortcuts

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