rset

package module
v0.0.0-...-61b1d9d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

rset

Set of uint32 with optional ranking.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID    uint32
	Score float32
}

type Iterator

type Iterator func(uint32) bool

type Set

type Set struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New() *Set

func (*Set) Add

func (s *Set) Add(v ...uint32)

func (*Set) And

func (s *Set) And(s2 *Set)

func (*Set) AndAny

func (s *Set) AndAny(sets ...*Set)

func (*Set) AndNot

func (s *Set) AndNot(s2 *Set)

func (*Set) Clear

func (s *Set) Clear()

func (*Set) Clone

func (s *Set) Clone() *Set

func (*Set) Count

func (s *Set) Count() uint64

func (*Set) Has

func (s *Set) Has(x uint32) bool

func (*Set) Insert

func (s *Set) Insert(key uint32, val float32)

func (*Set) Iterate

func (s *Set) Iterate(ranked bool, f Iterator)

func (*Set) Load

func (s *Set) Load(r io.Reader) error

func (*Set) Or

func (s *Set) Or(s2 *Set)

func (*Set) Range

func (s *Set) Range(last uint32, ids []uint32) int

func (*Set) Rank

func (s *Set) Rank(offset int, ids []uint32) int

func (*Set) Remove

func (s *Set) Remove(key uint32)

func (*Set) Save

func (s *Set) Save(w io.Writer) (err error)

func (*Set) Xor

func (s *Set) Xor(s2 *Set)

Jump to

Keyboard shortcuts

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