property

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Properties

type Properties []Property

Properties list.

func (*Properties) Add

func (pp *Properties) Add(key string, value any)

Add property.

func (Properties) AsMap

func (pp Properties) AsMap() map[string]any

AsMap output. It will merge properties with the same key into a slice.

func (Properties) Equal

func (pp Properties) Equal(target Properties) bool

func (Properties) Get

func (pp Properties) Get(key string) (any, bool)

Get property by its key insensitively.

func (Properties) Has

func (pp Properties) Has(key string) bool

Has property key insensitively.

func (Properties) MarshalJSON

func (pp Properties) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface to marshall a sorted list of properties into an object.

func (Properties) MarshalYAML

func (pp Properties) MarshalYAML() (any, error)

MarshalYAML implements yaml.Marshaler interface to marshall a sorted list of properties into an object.

func (*Properties) Set

func (pp *Properties) Set(key string, value any)

Set property. If it exists (case-insensitive) it will override it, otherwise it will just add it.

func (*Properties) UnmarshalJSON

func (pp *Properties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler interface to unmarshal an object into a sorted list of properties.

func (*Properties) UnmarshalYAML

func (pp *Properties) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler interface to unmarshal an object into a sorted list of properties.

type Property

type Property struct {
	Key   string
	Value any
}

Property key-value pair.

Jump to

Keyboard shortcuts

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