container

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Priority

type Priority interface{ ~int64 | ~float64 }

Priority defines the number types available to use as a priority value.

type PriorityMap added in v0.1.1

type PriorityMap[K comparable, V any, P Priority] struct {
	// contains filtered or unexported fields
}

PriorityMap provides a map with a built-in priority queue for trimming.

func NewPriorityMap added in v0.1.1

func NewPriorityMap[K comparable, V any, P Priority]() PriorityMap[K, V, P]

NewPriorityMap creates a new empty priority queue.

func (*PriorityMap[K, V, P]) Delete added in v0.1.1

func (p *PriorityMap[K, V, P]) Delete(key K)

Delete an element from the map.

func (*PriorityMap[K, V, P]) Get added in v0.1.1

func (p *PriorityMap[K, V, P]) Get(key K) (V, bool)

Get an element in the map by its key.

func (*PriorityMap[K, V, P]) Len added in v0.1.1

func (p *PriorityMap[K, V, P]) Len() int

Len returns the number of elements in the queue.

func (*PriorityMap[K, V, P]) Next added in v0.1.1

func (p *PriorityMap[K, V, P]) Next() (K, V, bool)

Next returns the next value in the map with the lowest priority.

func (*PriorityMap[K, V, P]) Set added in v0.1.1

func (p *PriorityMap[K, V, P]) Set(key K, val V, pri P)

Set an element in the map to the given value and priority.

Jump to

Keyboard shortcuts

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