orderedmap

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map[T any] interface {
	Set(key string, value T)
	Get(key string) (T, bool)
	Delete(key string)
	Keys() []string
	Values() []T
	Len() int
}

func New

func New[T any]() Map[T]

func NewSync

func NewSync[T any]() Map[T]

func NewSyncFromExisting

func NewSyncFromExisting[T any](m Map[T]) Map[T]

Does not copy the map, so the caller must ensure that the map is not modified

func NewSyncWithCapacity

func NewSyncWithCapacity[T any](capacity int) Map[T]

func NewWithCapacity

func NewWithCapacity[T any](capacity int) Map[T]

type OrderedMap

type OrderedMap[T any] struct {
	// contains filtered or unexported fields
}

func (*OrderedMap[T]) Delete

func (m *OrderedMap[T]) Delete(key string)

func (*OrderedMap[T]) Get

func (m *OrderedMap[T]) Get(key string) (T, bool)

func (*OrderedMap[T]) Keys

func (m *OrderedMap[T]) Keys() []string

func (*OrderedMap[T]) Len

func (m *OrderedMap[T]) Len() int

func (*OrderedMap[T]) Set

func (m *OrderedMap[T]) Set(key string, value T)

func (*OrderedMap[T]) Values

func (m *OrderedMap[T]) Values() []T

type OrderedSyncMap

type OrderedSyncMap[T any] struct {
	// contains filtered or unexported fields
}

func (*OrderedSyncMap[T]) Delete

func (m *OrderedSyncMap[T]) Delete(key string)

func (*OrderedSyncMap[T]) Get

func (m *OrderedSyncMap[T]) Get(key string) (T, bool)

func (*OrderedSyncMap[T]) Keys

func (m *OrderedSyncMap[T]) Keys() []string

func (*OrderedSyncMap[T]) Len

func (m *OrderedSyncMap[T]) Len() int

func (*OrderedSyncMap[T]) Set

func (m *OrderedSyncMap[T]) Set(key string, value T)

func (*OrderedSyncMap[T]) Values

func (m *OrderedSyncMap[T]) Values() []T

Jump to

Keyboard shortcuts

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