maps

package
v0.0.0-...-86fc4d5 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BitPartitionSize = 6
	PartitionMask    = (1 << BitPartitionSize) - 1
)
View Source
const (
	MaskLevel0 = (0b11111100 << 56)
)

Variables

View Source
var (
	ErrDeleteNotImplemented = fmt.Errorf("delete is not implemented")
	ErrKeyNotFound          = fmt.Errorf("key not found")
	ErrWrongType            = fmt.Errorf("wrong type")
)
View Source
var DefaultMapOptions = MapOptions{
	// contains filtered or unexported fields
}

Functions

func DiffSlice

func DiffSlice[T comparable](one []T, other []T) ([]T, bool)

DiffSlice checks that the two slices are equal and returns a slice containing the other slice and whether the slices differ.

func EqualsAny

func EqualsAny(a any, b any) bool

func EqualsAnyList

func EqualsAnyList(a []any, b []any) bool

func EqualsStringList

func EqualsStringList(a []string, b []string) bool

func HavePathInCommon

func HavePathInCommon(a *Map, b *Map) bool

func InformationPaths

func InformationPaths(f *Map) []string

InformationPaths returns a list of paths to all leaf nodes in a feature

func Intersection

func Intersection(one []string, other []string) []string

func RefToLookup

func RefToLookup(ref *Map) []string

func Union

func Union(one []string, other []string) []string

Types

type ComparableMap

type ComparableMap[T any] interface {
	Equals(other T) bool
}

type Key

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

func NewKey

func NewKey(key string, hash uint64) Key

type KeyValue

type KeyValue struct {
	Key   Key
	Value any
}

type Map

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

func Copy

func Copy(in *Map) *Map

func New

func New(opts ...MapOption) *Map

func NewFromItems

func NewFromItems(items ...any) *Map

func (*Map) Contains

func (m *Map) Contains(key string) bool

func (*Map) Copy

func (m *Map) Copy() *Map

func (*Map) Delete

func (m *Map) Delete(key string) (*Map, bool)

func (*Map) Diff

func (m *Map) Diff(other *Map) (*Map, error)

func (*Map) Equals

func (m *Map) Equals(other *Map) bool

func (*Map) Error

func (m *Map) Error() string

func (*Map) Get

func (m *Map) Get(key any) (any, bool)

func (*Map) GetBool

func (m *Map) GetBool(key string) (bool, error)

func (*Map) GetFloat

func (m *Map) GetFloat(key string) (float64, error)

func (*Map) GetInt

func (m *Map) GetInt(key string) (int, error)

func (*Map) GetMap

func (m *Map) GetMap(key string) (*Map, error)

func (*Map) GetString

func (m *Map) GetString(key string) (string, error)

func (*Map) Keys

func (m *Map) Keys() []string

func (*Map) MarshalJSON

func (m *Map) MarshalJSON() ([]byte, error)

func (*Map) Merge

func (m *Map) Merge(other *Map) *Map

func (*Map) Set

func (m *Map) Set(key string, value any) *Map

Set implements node.

func (*Map) ToMap

func (m *Map) ToMap() map[string]any

func (*Map) UnmarshalJSON

func (m *Map) UnmarshalJSON(d []byte) error

type MapOption

type MapOption func(*MapOptions)

func WithHasher

func WithHasher(h func() hash.Hash64) MapOption

type MapOptions

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

Jump to

Keyboard shortcuts

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