orderedtypes

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindNull = iota
	KindBool
	KindString
	KindInt
	KindFloat
	KindTimestamp
	KindSeq
	KindMap
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Any

type Any struct {
	Kind  int
	Value any
}

func (Any) MarshalJSON

func (a Any) MarshalJSON() ([]byte, error)

func (*Any) UnmarshalJSON

func (a *Any) UnmarshalJSON(value []byte) error

func (*Any) UnmarshalYAML

func (a *Any) UnmarshalYAML(node *yaml.Node) error

type Map

type Map[K string, V any] struct {
	Items map[K]V
	Order []K
}

func NewMap added in v0.3.0

func NewMap[K string, V any]() Map[K, V]

func (*Map[K, V]) Get

func (m *Map[K, V]) Get(k K) (V, bool)

func (*Map[K, V]) Iter

func (m *Map[K, V]) Iter() iter.Seq2[K, V]

func (Map[K, V]) MarshalJSON

func (m Map[K, V]) MarshalJSON() ([]byte, error)

func (*Map[K, V]) Set

func (m *Map[K, V]) Set(k K, v V)

func (*Map[K, V]) Size

func (m *Map[K, V]) Size() int

func (*Map[K, V]) UnmarshalJSON

func (m *Map[K, V]) UnmarshalJSON(value []byte) error

func (*Map[K, V]) UnmarshalYAML

func (m *Map[K, V]) UnmarshalYAML(node *yaml.Node) error

code has been taken from https://github.com/wk8/go-ordered-map/blob/master/yaml.go

Jump to

Keyboard shortcuts

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