property

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: Apache-2.0 Imports: 10 Imported by: 2

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 PropertiesFromMap added in v2.9.0

func PropertiesFromMap(kvs map[string]string) Properties

PropertiesFromMap returns the key-value pairs as Properties, ordered by key.

func (*Properties) Add

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

Add adds a property to the list.

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

Equal returns true if pp and target have the same properties in the same order.

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