wantlist

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

package wantlist implements an object for bitswap that contains the keys that a given peer wants.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Key      key.Key
	Priority int

	RefCnt int
}

type ThreadSafe

type ThreadSafe struct {
	Wantlist Wantlist
	// contains filtered or unexported fields
}

func NewThreadSafe

func NewThreadSafe() *ThreadSafe

func (*ThreadSafe) Add

func (w *ThreadSafe) Add(k key.Key, priority int) bool

func (*ThreadSafe) AddEntry added in v0.4.2

func (w *ThreadSafe) AddEntry(e *Entry) bool

func (*ThreadSafe) Contains

func (w *ThreadSafe) Contains(k key.Key) (*Entry, bool)

func (*ThreadSafe) Entries

func (w *ThreadSafe) Entries() []*Entry

func (*ThreadSafe) Len

func (w *ThreadSafe) Len() int

func (*ThreadSafe) Remove

func (w *ThreadSafe) Remove(k key.Key) bool

func (*ThreadSafe) SortedEntries

func (w *ThreadSafe) SortedEntries() []*Entry

type Wantlist

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

not threadsafe

func New

func New() *Wantlist

func (*Wantlist) Add

func (w *Wantlist) Add(k key.Key, priority int) bool

func (*Wantlist) AddEntry added in v0.4.2

func (w *Wantlist) AddEntry(e *Entry) bool

func (*Wantlist) Contains

func (w *Wantlist) Contains(k key.Key) (*Entry, bool)

func (*Wantlist) Entries

func (w *Wantlist) Entries() []*Entry

func (*Wantlist) Len

func (w *Wantlist) Len() int

func (*Wantlist) Remove

func (w *Wantlist) Remove(k key.Key) bool

func (*Wantlist) SortedEntries

func (w *Wantlist) SortedEntries() []*Entry

Jump to

Keyboard shortcuts

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