orderedjson

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitOption

type InitOption func(*Object)

func WithInitialData

func WithInitialData(pairs ...Pair) InitOption

type Object

type Object struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...InitOption) Object

func (*Object) Contains

func (o *Object) Contains(key string) bool

func (*Object) Delete

func (o *Object) Delete(key string)

func (*Object) Get

func (o *Object) Get(key string) (any, bool)

func (*Object) Keys

func (o *Object) Keys() []string

func (*Object) Len

func (o *Object) Len() int

func (Object) MarshalJSON

func (o Object) MarshalJSON() ([]byte, error)

func (*Object) Pairs added in v0.5.5

func (o *Object) Pairs() iter.Seq2[string, any]

func (*Object) Set

func (o *Object) Set(key string, value any)

func (*Object) ToMap

func (o *Object) ToMap() map[string]any

func (*Object) UnmarshalJSON

func (o *Object) UnmarshalJSON(data []byte) error

type Pair

type Pair struct {
	Key   string
	Value any
}

Jump to

Keyboard shortcuts

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