data

package
v22.11.9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToMapStringOfString

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 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 {
	GetID() (string, error) // GetID Returns the ID of the instance
}

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 FromMap

func FromMap(m Map) (Map, error)

func NewMap

func NewMap() Map

NewMap ...

func (Map) Contains

func (m Map) Contains(key string) bool

Contains tells if a key is present in Map

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

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 *Map) (Map, error)

func (Map) Values

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

Values returns a slice with all values of the map

type Named

type Named interface {
	GetName() string // GetName Returns the name of the instance
}

Named proposes methods to identify a struct

type NullValue

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

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