Documentation
¶
Overview ¶
Package orderedmap 提供键名类型为 string 的有序 map
Index ¶
- type OrderedMap
- func (m *OrderedMap[V]) Add(key string, value V)
- func (m *OrderedMap[V]) Delete(key string)
- func (m *OrderedMap[V]) Get(key string) (V, bool)
- func (m *OrderedMap[V]) Iter() iter.Seq2[string, V]
- func (m *OrderedMap[V]) Len() int
- func (m *OrderedMap[V]) MarshalJSON() ([]byte, error)
- func (m *OrderedMap[V]) MarshalYAML() ([]byte, error)
- func (m *OrderedMap[V]) Set(key string, value V)
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]) 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)
Click to show internal directories.
Click to hide internal directories.