peers

package
v0.0.26 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPeerNotFound = errors.New("peer not found")
)

Functions

func NewSQLitePersistence

func NewSQLitePersistence(db *sql.DB) sqlitePersistence

Types

type MemoryPersistence

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

func NewMemoryPersistence

func NewMemoryPersistence() *MemoryPersistence

func (*MemoryPersistence) Add

func (p *MemoryPersistence) Add(groupID state.GroupID, peerID state.PeerID) error

func (*MemoryPersistence) Exists

func (p *MemoryPersistence) Exists(groupID state.GroupID, peerID state.PeerID) (bool, error)

func (*MemoryPersistence) GetByGroupID

func (p *MemoryPersistence) GetByGroupID(groupID state.GroupID) ([]state.PeerID, error)

type Persistence

type Persistence interface {
	Add(state.GroupID, state.PeerID) error
	GetByGroupID(group state.GroupID) ([]state.PeerID, error)
	Exists(state.GroupID, state.PeerID) (bool, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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