linear

package
v0.0.0-...-ecc870c Latest Latest
Warning

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

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

Documentation

Overview

package linear provides a container.Mapper implementation backed by a slice and linear search for benchmark reference.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyInterface

type KeyInterface interface {
	string | []byte
}

type Linear

type Linear[K KeyInterface, V any] struct {
	// contains filtered or unexported fields
}

func New

func New[K KeyInterface, V any](capacity int) *Linear[K, V]

func (*Linear[K, V]) Delete

func (m *Linear[K, V]) Delete(key K)

func (*Linear[K, V]) Get

func (m *Linear[K, V]) Get(key K) (v V, ok bool)

func (*Linear[K, V]) Len

func (m *Linear[K, V]) Len() int

func (*Linear[K, V]) Reset

func (m *Linear[K, V]) Reset()

func (*Linear[K, V]) Set

func (m *Linear[K, V]) Set(key K, value V)

func (*Linear[K, V]) Visit

func (m *Linear[K, V]) Visit(fn func(K, V) bool)

Jump to

Keyboard shortcuts

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