util

package
v0.0.0-...-890b9a8 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Priority InfoHash
	NodeAddr string
}

type MinHeap

type MinHeap []Item

func (MinHeap) Len

func (m MinHeap) Len() int

func (MinHeap) Less

func (m MinHeap) Less(i int, j int) bool

func (*MinHeap) Pop

func (m *MinHeap) Pop() any

func (*MinHeap) Push

func (m *MinHeap) Push(x any)

func (MinHeap) Swap

func (m MinHeap) Swap(i int, j int)

edits in memory, should use sync mechanism to avoid race conditions

type SyncSet

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

func NewSet

func NewSet() *SyncSet

func (*SyncSet) Add

func (s *SyncSet) Add(key string)

func (*SyncSet) Contains

func (s *SyncSet) Contains(key string) bool

func (*SyncSet) Equal

func (s *SyncSet) Equal(other *SyncSet) bool

func (*SyncSet) GetKeys

func (s *SyncSet) GetKeys() []string

func (*SyncSet) Len

func (s *SyncSet) Len() uint32

func (*SyncSet) Remove

func (s *SyncSet) Remove(key string)

Jump to

Keyboard shortcuts

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