Documentation ¶
Overview ¶
Package kv implements core key-value type as a base for labels and annotations.
Index ¶
- type KV
- func (kv *KV) Delete(key string)
- func (kv *KV) Do(ts func(temp kvutils.TempKV))
- func (kv KV) Empty() bool
- func (kv KV) Equal(other KV) bool
- func (kv *KV) Get(key string) (string, bool)
- func (kv KV) Keys() []string
- func (kv KV) Len() int
- func (kv *KV) Raw() map[string]string
- func (kv *KV) Set(key, value string)
- func (kv KV) ToYAML(label string) []*yaml.Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
KV is a set free-form of key-value pairs.
Order of keys is not guaranteed.
KV support copy-on-write semantics, so metadata copies share common labels as long as possible.
func (*KV) Delete ¶
Delete the key.
Deleting the key copies the map, so metadata copies share common storage as long as possible.
func (*KV) Do ¶ added in v0.3.1
Do executes a function with a temporary copy of the map. It copies the map back only if the function modifies it.
Click to show internal directories.
Click to hide internal directories.