lstoremem

package
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowEmptyRestore = true

Define if storage will accept empty dumps.

Functions

func NewAddrBook

func NewAddrBook() core.AddrBook

func NewHeadBook

func NewHeadBook() core.HeadBook

func NewKeyBook

func NewKeyBook() core.KeyBook

func NewLogstore

func NewLogstore() core.Logstore

NewLogstore creates an in-memory threadsafe collection of thread logs.

func NewThreadMetadata

func NewThreadMetadata() core.ThreadMetadata

Types

type AddrList

type AddrList []ma.Multiaddr

func (AddrList) Len

func (al AddrList) Len() int

func (AddrList) Less

func (al AddrList) Less(i, j int) bool

func (AddrList) Swap

func (al AddrList) Swap(i, j int)

type AddrSubManager

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

An abstracted, pub-sub manager for address streams. Extracted from memoryAddrBook in order to support additional implementations.

func NewAddrSubManager

func NewAddrSubManager() *AddrSubManager

NewAddrSubManager initializes an AddrSubManager.

func (*AddrSubManager) AddrStream

func (mgr *AddrSubManager) AddrStream(ctx context.Context, p peer.ID, initial []ma.Multiaddr) (<-chan ma.Multiaddr, error)

AddrStream creates a new subscription for a given peer ID, pre-populating the channel with any addresses we might already have on file.

func (*AddrSubManager) BroadcastAddr

func (mgr *AddrSubManager) BroadcastAddr(p peer.ID, addr ma.Multiaddr)

BroadcastAddr broadcasts a new address to all subscribed streams.

Jump to

Keyboard shortcuts

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