data

package
v21.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnonymousMapToStringMap

func AnonymousMapToStringMap(in map[interface{}]interface{}) map[string]interface{}

func ToMapStringOfString added in v21.11.1

func ToMapStringOfString(in map[interface{}]interface{}) map[string]string

ToMapStringOfString converts a map[interface{}]interface{} (something that viper may return for example) to a map[string]string

Types

type Annotatable

type Annotatable interface {
	Annotate(key string, value Annotation) Annotatable // adds an annotation to instance, returning instance
	Annotations() Annotations                          // gives the annotations
	Annotation(key string) (Annotation, bool)          // gives one annotation identified by field
}

Annotatable ...

type Annotation

type Annotation interface{}

Annotation ...

type Annotations

type Annotations Map

Annotations ...

type AnonymousMap

type AnonymousMap map[interface{}]interface{}

AnonymousMap ...

type Clonable

type Clonable interface {
	IsNull() bool                       // tells of Clonable represents a null value
	Clone() (Clonable, error)           // allows duplication of a Clonable
	Replace(Clonable) (Clonable, error) // allows replacing a Clonable with data from another one
}

Clonable is the interface a struct must satisfy to be able to be cloned

type Identifiable

type Identifiable interface {
	GetName() string // GetName Returns the name of the instance
	GetID() string   // GetID Returns the ID of the instance
}

Identifiable proposes methods to identify a struct

type ImmutableKeyValue

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

ImmutableKeyValue is a key/value that cannot be changed

func NewImmutableKeyValue

func NewImmutableKeyValue(key string, values ...interface{}) ImmutableKeyValue

NewImmutableKeyValue creates a new immutable key/Value If no values is passed, sets the content of value to nil If at least 1 value is passed, the first one only is considered (trick to allow to create an instance without value parameter)

func (ImmutableKeyValue) Key

func (kv ImmutableKeyValue) Key() string

Key returns the key of the key/value

func (ImmutableKeyValue) Mutate

func (i ImmutableKeyValue) Mutate() KeyValue

Mutate creates a KeyValue from ImmutableKeyValue

func (ImmutableKeyValue) Value

func (kv ImmutableKeyValue) Value() interface{}

Value returns the value of the key/value

type IndexedListOfStrings

type IndexedListOfStrings map[uint]string

IndexedListOfStrings contains a list of string (being ID, IP, ...) of nodes indexed by node Numerical ID.

func (IndexedListOfStrings) Keys

func (ilos IndexedListOfStrings) Keys() []uint

Keys returns a slice with keys from map[uint]string

func (IndexedListOfStrings) KeysAndValues

func (ilos IndexedListOfStrings) KeysAndValues() ([]uint, []string)

KeysAndValues returns a slice with keys and a slice with values from map[uint]string

func (IndexedListOfStrings) Values

func (ilos IndexedListOfStrings) Values() []string

Values returns a slice with values from map[uint]string

type KeyValue

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

KeyValue is a key/value that can be updated (mutable)

func NewKeyValue

func NewKeyValue(name string, values ...interface{}) KeyValue

NewKeyValue creates a new mutable Key/Value

func (KeyValue) Key

func (kv KeyValue) Key() string

Key returns the key of the key/value

func (*KeyValue) SetValue

func (m *KeyValue) SetValue(value interface{})

SetValue changes the value of the mutable key/value

func (KeyValue) Value

func (kv KeyValue) Value() interface{}

Value returns the value of the key/value

type Map

type Map map[string]interface{}

Map ...

func NewMap

func NewMap() Map

NewMap ...

func (Map) Clone

func (m Map) Clone() (Clonable, error)

Clone clones the content of a Variables satisfies interface Clonable

func (Map) Contains

func (m Map) Contains(key string) bool

Contains tells if a key is present in Map

func (Map) FakeClone added in v21.11.1

func (m Map) FakeClone() (Map, error)

func (*Map) FakeReplace added in v21.11.1

func (m *Map) FakeReplace(src Clonable) (Map, error)

func (Map) ForceMerge

func (m Map) ForceMerge(src Map) Map

ForceMerge adds missing keys from source in p and replace the ones in source already in p

func (Map) IsNull added in v21.11.1

func (m Map) IsNull() bool

func (Map) Keys

func (m Map) Keys() []string

Keys returns a slice with all keys of the map

func (Map) Merge

func (m Map) Merge(src Map) Map

Merge add missing keys from source

func (*Map) Replace

func (m *Map) Replace(src Clonable) (Clonable, error)

Replace replaces the content of the Map with content of another one satisfies interface Clonable

func (Map) Values

func (m Map) Values() []interface{}

Values returns a slice with all values of the map

type NullValue added in v21.11.1

type NullValue interface {
	IsNull() bool // Tells if the underlying instance is a Null Value
}

NullValue ...

type Serializable

type Serializable interface {
	Serialize() ([]byte, error)
	Deserialize([]byte) error
}

Serializable is the interface allowing the conversion of satisfying struct to []byte (Serialize() and reverse operation (Deserialize()

type Validatable added in v21.11.1

type Validatable interface {
	Valid() bool
}

Validatable interface is used to check data validity

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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