xmap

package
v0.0.0-...-5b377e2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 1 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 {
	Key   []byte
	Value any
}

type M

type M struct {
	NumBuckets int
	Items      []Item
	// contains filtered or unexported fields
}

func (*M) Get

func (m *M) Get(key []byte) any

func (*M) Init

func (m *M) Init()

func (*M) Set

func (m *M) Set(key []byte, value any)

type Measurements

type Measurements struct {
	Min   int
	Max   int
	Sum   int
	Count int
}

Measurements, as there is no need to keep all numbers around, we can compute them on the fly.

type StaticMap

type StaticMap struct {
	M []*Measurements
}

StaticMap is a tailored "map" for cities.txt.

func NewStaticMap

func NewStaticMap() *StaticMap

func (*StaticMap) Get

func (m *StaticMap) Get(key string) *Measurements

func (*StaticMap) Index

func (m *StaticMap) Index(s string) (index int)

func (*StaticMap) Init

func (m *StaticMap) Init()

func (*StaticMap) Set

func (m *StaticMap) Set(key string, ms *Measurements)

Jump to

Keyboard shortcuts

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