discovery

package
v0.6.0-dev Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrChallengeMismatch         warpnet.WarpError = "challenge mismatch"
	ErrChallengeSignatureInvalid warpnet.WarpError = "invalid challenge signature"
)

Variables

This section is empty.

Functions

func NewBootstrapDiscoveryService

func NewBootstrapDiscoveryService(ctx context.Context) *discoveryService

func NewDiscoveryService

func NewDiscoveryService(
	ctx context.Context,
	userRepo UserStorer,
	nodeRepo NodeStorer,
) *discoveryService

Types

type DiscoveryHandler

type DiscoveryHandler func(warpnet.WarpAddrInfo)

type DiscoveryInfoStorer

type DiscoveryInfoStorer interface {
	NodeInfo() warpnet.NodeInfo
	Peerstore() warpnet.WarpPeerstore
	SimpleConnect(warpnet.WarpAddrInfo) error
	GenericStream(nodeId string, path stream.WarpRoute, data any) ([]byte, error)
}

type NodeStorer

type NodeStorer interface {
	BlocklistRemove(peerId string) error
	IsBlocklisted(peerId string) bool
	Blocklist(peerId string) error
	BlocklistTerm(peerId string) (*database.BlocklistTerm, error)
}

type UserStorer

type UserStorer interface {
	Create(user domain.User) (domain.User, error)
	Update(userId string, newUser domain.User) (domain.User, error)
	GetByNodeID(nodeID string) (user domain.User, err error)
}

Jump to

Keyboard shortcuts

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