heap

package
v1.95.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2025 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache map[string]any

type Context

type Context struct {
	B int // context before
	A int // context after
	// contains filtered or unexported fields
}

type Filter

type Filter struct {
	Pattern string         // filter pattern
	Context Context        // filter context
	Regex   *regexp.Regexp // filter regex
	// contains filtered or unexported fields
}

type Hash

type Hash map[string][]byte

type Heap

type Heap struct {
	sync.RWMutex

	Title string // heap title
	Path  string // file path
	Base  string // base path

	Type types.Heap // heap type
	// contains filtered or unexported fields
}

func New

func New(title, path, base string, ht types.Heap) *Heap

func (*Heap) AddFilter

func (h *Heap) AddFilter(pattern string, b, a int)

func (*Heap) Bytes

func (h *Heap) Bytes() []byte

func (*Heap) Cache

func (h *Heap) Cache() Cache

func (*Heap) Count

func (h *Heap) Count() int

func (*Heap) DelFilter

func (h *Heap) DelFilter()

func (*Heap) Ensure

func (h *Heap) Ensure() *Heap

func (*Heap) Entropy added in v1.82.0

func (h *Heap) Entropy(n, m float64) float64

https://gist.github.com/n2p5/4eda328b080c9f09eff928ad47228ab1

func (*Heap) FMap

func (h *Heap) FMap() *smap.SMap

func (*Heap) Filters

func (h *Heap) Filters() []*Filter

func (*Heap) HasContext

func (h *Heap) HasContext() bool

func (*Heap) HashSum

func (h *Heap) HashSum(algo string) ([]byte, error)

func (*Heap) LastCount

func (h *Heap) LastCount() (int, int)

func (*Heap) LastFilter

func (h *Heap) LastFilter() *Filter

func (*Heap) Len

func (h *Heap) Len() int64

func (*Heap) MMap

func (h *Heap) MMap() *mmap.MMap

func (*Heap) ModContext

func (h *Heap) ModContext(delta int) bool

func (*Heap) Patterns

func (h *Heap) Patterns() []string

func (*Heap) Reload

func (h *Heap) Reload()

func (*Heap) SMap

func (h *Heap) SMap() *smap.SMap

func (*Heap) String

func (h *Heap) String() string

func (*Heap) Strings

func (h *Heap) Strings(n, m int) <-chan text.String

func (*Heap) ThrowAway

func (h *Heap) ThrowAway()

type SDHash

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

func (*SDHash) BlockSize

func (sd *SDHash) BlockSize() int

func (*SDHash) Reset

func (sd *SDHash) Reset()

func (*SDHash) Size

func (sd *SDHash) Size() int

func (*SDHash) Sum

func (sd *SDHash) Sum(_ []byte) []byte

func (*SDHash) Write

func (sd *SDHash) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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