{"modulePath":"github.com/CS-SI/SafeScale/v21","version":"v21.11.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package data\n\n## Functions\n\n```go\nfunc AnonymousMapToStringMap(in map[interface{}]interface{}) map[string]interface{}\n```\n\n```go\nfunc ToMapStringOfString(in map[interface{}]interface{}) map[string]string\n```\nToMapStringOfString converts a map\\[interface{}]interface{} (something that viper may return for example) to a map\\[string]string\n\n## Types\n\n```go\ntype Annotatable interface {\n\tAnnotate(key string, value Annotation) Annotatable // adds an annotation to instance, returning instance\n\tAnnotations() Annotations                          // gives the annotations\n\tAnnotation(key string) (Annotation, bool)          // gives one annotation identified by field\n}\n```\nAnnotatable ...\n\n```go\ntype Annotation interface{}\n```\nAnnotation ...\n\n```go\ntype Annotations Map\n```\nAnnotations ...\n\n```go\ntype AnonymousMap map[interface{}]interface{}\n```\nAnonymousMap ...\n\n```go\ntype Clonable interface {\n\tIsNull() bool                       // tells of Clonable represents a null value\n\tClone() (Clonable, error)           // allows duplication of a Clonable\n\tReplace(Clonable) (Clonable, error) // allows replacing a Clonable with data from another one\n}\n```\nClonable is the interface a struct must satisfy to be able to be cloned\n\n```go\ntype Identifiable interface {\n\tGetName() string // GetName Returns the name of the instance\n\tGetID() string   // GetID Returns the ID of the instance\n}\n```\nIdentifiable proposes methods to identify a struct\n\n```go\ntype ImmutableKeyValue struct {\n\t// contains filtered or unexported fields\n}\n```\nImmutableKeyValue is a key/value that cannot be changed\n\n```go\nfunc NewImmutableKeyValue(key string, values ...interface{}) ImmutableKeyValue\n```\nNewImmutableKeyValue 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)\n\n```go\nfunc (kv ImmutableKeyValue) Key() string\n```\nKey returns the key of the key/value\n\n```go\nfunc (i ImmutableKeyValue) Mutate() KeyValue\n```\nMutate creates a KeyValue from ImmutableKeyValue\n\n```go\nfunc (kv ImmutableKeyValue) Value() interface{}\n```\nValue returns the value of the key/value\n\n```go\ntype IndexedListOfStrings map[uint]string\n```\nIndexedListOfStrings contains a list of string (being ID, IP, ...) of nodes indexed by node Numerical ID.\n\n```go\nfunc (ilos IndexedListOfStrings) Keys() []uint\n```\nKeys returns a slice with keys from map\\[uint]string\n\n```go\nfunc (ilos IndexedListOfStrings) KeysAndValues() ([]uint, []string)\n```\nKeysAndValues returns a slice with keys and a slice with values from map\\[uint]string\n\n```go\nfunc (ilos IndexedListOfStrings) Values() []string\n```\nValues returns a slice with values from map\\[uint]string\n\n```go\ntype KeyValue struct {\n\t// contains filtered or unexported fields\n}\n```\nKeyValue is a key/value that can be updated (mutable)\n\n```go\nfunc NewKeyValue(name string, values ...interface{}) KeyValue\n```\nNewKeyValue creates a new mutable Key/Value\n\n```go\nfunc (kv KeyValue) Key() string\n```\nKey returns the key of the key/value\n\n```go\nfunc (m *KeyValue) SetValue(value interface{})\n```\nSetValue changes the value of the mutable key/value\n\n```go\nfunc (kv KeyValue) Value() interface{}\n```\nValue returns the value of the key/value\n\n```go\ntype Map map[string]interface{}\n```\nMap ...\n\n```go\nfunc NewMap() Map\n```\nNewMap ...\n\n```go\nfunc (m Map) Clone() (Clonable, error)\n```\nClone clones the content of a Variables satisfies interface Clonable\n\n```go\nfunc (m Map) Contains(key string) bool\n```\nContains tells if a key is present in Map\n\n```go\nfunc (m Map) FakeClone() (Map, error)\n```\n\n```go\nfunc (m *Map) FakeReplace(src Clonable) (Map, error)\n```\n\n```go\nfunc (m Map) ForceMerge(src Map) Map\n```\nForceMerge adds missing keys from source in p and replace the ones in source already in p\n\n```go\nfunc (m Map) IsNull() bool\n```\n\n```go\nfunc (m Map) Keys() []string\n```\nKeys returns a slice with all keys of the map\n\n```go\nfunc (m Map) Merge(src Map) Map\n```\nMerge add missing keys from source\n\n```go\nfunc (m *Map) Replace(src Clonable) (Clonable, error)\n```\nReplace replaces the content of the Map with content of another one satisfies interface Clonable\n\n```go\nfunc (m Map) Values() []interface{}\n```\nValues returns a slice with all values of the map\n\n```go\ntype NullValue interface {\n\tIsNull() bool // Tells if the underlying instance is a Null Value\n}\n```\nNullValue ...\n\n```go\ntype Serializable interface {\n\tSerialize() ([]byte, error)\n\tDeserialize([]byte) error\n}\n```\nSerializable is the interface allowing the conversion of satisfying struct to \\[]byte (Serialize() and reverse operation (Deserialize()\n\n```go\ntype Validatable interface {\n\tValid() bool\n}\n```\nValidatable interface is used to check data validity\n\n","path":"github.com/CS-SI/SafeScale/v21/lib/utils/data","name":"data","synopsis":"","isRedistributable":true}
