Dictionary

package
v0.0.0-...-6bd456b Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Set(key, value interface{}) Interface
	Get(key interface{}) Result.Interface
	Has(key interface{}) Boolean.Interface
	Delete(key interface{}) Interface
	Len() int
	Keys() Array.Interface
	Values() Array.Interface
	Each(fn func(key, value interface{}) Result.Interface) Result.Interface
	IsNull() bool
}

Interface is the public contract of a key→value composite — the sibling of Array. Keys are arbitrary comparable values; values are arbitrary. Fallible lookups return a Result rather than (value, ok) or a bare nil, and presence tests return a Boolean — both in keeping with the go-composites grammar.

func New

func New(options ...Option) Interface

New creates an empty Dictionary (unless seeded via options).

func Null

func Null() Interface

Null returns the Null-Object Dictionary.

type Option

type Option func(*data)

Option is a functional option for New.

func WithPairs

func WithPairs(pairs map[interface{}]interface{}) Option

WithPairs seeds the Dictionary with an initial set of key→value pairs.

Jump to

Keyboard shortcuts

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