p2p

package
v0.0.0-...-891c386 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MDNS     bool
	URI      string
	TCPAddr  string
	TCPPort  int
	QUICAddr string
	QUICPort int
	KeyFile  string
	Log      *log.Entry
}

func DevConfig

func DevConfig() Config

func (*Config) Init

func (cfg *Config) Init()

Init overrides the configuration values of the Config object with those passed in as flags

type Host

type Host struct {
	host.Host
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, db *store.Store, cfg *Config) (*Host, error)

type TopicHandler

type TopicHandler struct {
	// contains filtered or unexported fields
}

func NewChannelDiscovery

func NewChannelDiscovery(pctx context.Context, h *Host, cfg *Config) (*TopicHandler, error)

func NewTopicHandler

func NewTopicHandler(h *Host, channel *store.Channel, start []byte, onRecv, onPublish entryHandler) (*TopicHandler, error)

func (*TopicHandler) Done

func (th *TopicHandler) Done()

Done is required to implement Store.SubscriptionTarget

func (*TopicHandler) ID

func (th *TopicHandler) ID() helpers.UUID

ID is required to implement Store.SubscriptionTarget

func (*TopicHandler) Publish

func (th *TopicHandler) Publish(entry *pb.Msg)

Publish is the callback required to implement Store.SubscriptionTarget. It gets called by the Store every time our subscription has a new entry to handle.

Jump to

Keyboard shortcuts

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