orderedmap

package
v0.104.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package orderedmap 提供键名类型为 string 的有序 map

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrderedMap

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

OrderedMap 键名类型为 string 的有序 map

func New

func New[V any](c int) *OrderedMap[V]

func (*OrderedMap[V]) Add

func (m *OrderedMap[V]) Add(key string, value V)

Add 添加新项,如果已经存在,则 panic

func (*OrderedMap[V]) Delete

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

func (*OrderedMap[V]) Get

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

func (*OrderedMap[V]) Iter

func (m *OrderedMap[V]) Iter() iter.Seq2[string, V]

func (*OrderedMap[V]) Len

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

func (*OrderedMap[V]) MarshalJSON

func (m *OrderedMap[V]) MarshalJSON() ([]byte, error)

func (*OrderedMap[V]) MarshalYAML

func (m *OrderedMap[V]) MarshalYAML() ([]byte, error)

func (*OrderedMap[V]) Set

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

Set 设置键值对,如果已经存在,则覆盖。

Jump to

Keyboard shortcuts

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