custommaps

package
v0.0.0-...-7665df1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WithOrder

type WithOrder[T any] struct {
	// contains filtered or unexported fields
}

WithOrder is like map, but also retains information about the order the keys of the object where in when it was unmarshalled from JSON.

func (*WithOrder[T]) Get

func (b *WithOrder[T]) Get(key string) (*T, bool)

Get returns the value associated with the given key, and a boolean indicating whether the key was present.

func (*WithOrder[T]) OrderedKeys

func (b *WithOrder[T]) OrderedKeys() []string

Keys returns the keys of the map in the order they were unmarshalled from JSON.

func (*WithOrder[T]) OrderedValues

func (b *WithOrder[T]) OrderedValues() []*T

OrderedValues returns the values of the map in the order they were unmarshalled from JSON.

func (*WithOrder[T]) UnmarshalJSON

func (b *WithOrder[T]) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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