Documentation
¶
Index ¶
- type Entry
- type Map
- func (om *Map[K, V]) Entries() []Entry[K, V]
- func (om *Map[K, V]) Get(key K) (V, bool)
- func (om *Map[K, V]) Keys() []K
- func (om *Map[K, V]) MarshalJSON() ([]byte, error)
- func (om *Map[K, V]) MarshalYAML() ([]byte, error)
- func (om *Map[K, V]) Set(key K, val V)
- func (om *Map[K, V]) ToBuiltInMap() map[K]V
- func (om *Map[K, V]) UnmarshalJSON(data []byte) error
- func (om *Map[K, V]) UnmarshalYAML(node ast.Node) error
- type MemFS
- type MemFile
- func (f *MemFile) Close() error
- func (f *MemFile) IsDir() bool
- func (f *MemFile) ModTime() time.Time
- func (f *MemFile) Mode() fs.FileMode
- func (f *MemFile) Name() string
- func (f *MemFile) Read(b []byte) (int, error)
- func (f *MemFile) Size() int64
- func (f *MemFile) Stat() (fs.FileInfo, error)
- func (f *MemFile) Sys() any
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
Map is a custom Map impementation that maintains order when adding new items and when unmarshalling from JSON and YAML.
func (*Map[K, V]) Get ¶
Get returns the value associated with a given key in the map. It follows the interface of the built in map type returning true/false in the second parameter to indicate if the key was found in the map.
func (*Map[K, V]) Keys ¶
func (om *Map[K, V]) Keys() []K
Keys returns the keys int the map as a slice.
func (*Map[K, V]) MarshalJSON ¶
func (*Map[K, V]) MarshalYAML ¶
MarshalYAML implements the yaml node marshaler to preserve insertion order.
func (*Map[K, V]) Set ¶
func (om *Map[K, V]) Set(key K, val V)
Set adds a new key/value pair and keeps track of the order in which it was added.
func (*Map[K, V]) ToBuiltInMap ¶
func (om *Map[K, V]) ToBuiltInMap() map[K]V
ToBuiltInMap converts the custom ordered map into a built in map type, losing order guarantees
func (*Map[K, V]) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface to enable json.Unarmshal.