gods

package module
v0.0.0-...-1271aee Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: MIT Imports: 1 Imported by: 1

README

gods

Go Data Structures.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Key   string
	Value string
}

Entry is a key-value pair.

type Ordered

type Ordered []Entry

Ordered is an ordered dictionary type.

func NewOrdered

func NewOrdered(entries ...Entry) *Ordered

NewOrdered returns a new ordered dictionary with the given entries.

func (*Ordered) Add

func (dict *Ordered) Add(key, value string)

Add an entry with the given key and value.

func (Ordered) All

func (dict Ordered) All(key string) []string

All returns all entries with the given key.

func (*Ordered) Delete

func (dict *Ordered) Delete(key string)

Delete all entries with the given key.

func (Ordered) Get

func (dict Ordered) Get(key string) string

Get returns the first entry with the given key.

func (Ordered) Indices

func (dict Ordered) Indices(filter func(Entry) bool) []int

Indices lists the indices for entries matching the filter.

func (Ordered) Iter

func (dict Ordered) Iter() []Entry

Iter returns the underlying slice.

func (Ordered) Len

func (dict Ordered) Len() int

Len returns the length of the dictionary.

func (*Ordered) Set

func (dict *Ordered) Set(key, value string)

Set will delete all entries with the given key and insert a new entry.

Jump to

Keyboard shortcuts

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