wot

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWotLevel = 3

Variables

This section is empty.

Functions

func Initialize

func Initialize(ctx context.Context, model Model)

func PeriodicRefresh

func PeriodicRefresh(ctx context.Context, interval time.Duration)

Types

type Initializer

type Initializer interface {
	Init(ctx context.Context)
}

type Model

type Model interface {
	Has(ctx context.Context, pubkey string) bool
}

func GetInstance

func GetInstance() Model

type Refresher

type Refresher interface {
	Refresh(ctx context.Context)
}

type SimpleInMemory

type SimpleInMemory struct {

	// Dependencies for Refresh
	Pool               *nostr.SimplePool
	WhitelistedPubKeys map[string]struct{}
	SeedRelays         []string
	WotDepth           int
	MinFollowers       int
	WotFetchTimeout    int
	// contains filtered or unexported fields
}

func NewSimpleInMemory

func NewSimpleInMemory(pool *nostr.SimplePool, whitelistedPubKeys map[string]struct{}, seedRelays []string, wotDepth int, minFollowers int, wotFetchTimeout int) *SimpleInMemory

func (*SimpleInMemory) Has

func (wt *SimpleInMemory) Has(_ context.Context, pubKey string) bool

func (*SimpleInMemory) Init

func (wt *SimpleInMemory) Init(ctx context.Context)

func (*SimpleInMemory) Refresh

func (wt *SimpleInMemory) Refresh(ctx context.Context)

Jump to

Keyboard shortcuts

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