Documentation ¶
Index ¶
- func AnonymousMapToStringMap(in map[interface{}]interface{}) map[string]interface{}
- func ToMapStringOfString(in map[interface{}]interface{}) map[string]string
- type Annotatable
- type Annotation
- type Annotations
- type AnonymousMap
- type Clonable
- type Identifiable
- type ImmutableKeyValue
- type IndexedListOfStrings
- type KeyValue
- type Map
- func (m Map) Clone() (Clonable, error)
- func (m Map) Contains(key string) bool
- func (m Map) FakeClone() (Map, error)
- func (m *Map) FakeReplace(src Clonable) (Map, error)
- func (m Map) ForceMerge(src Map) Map
- func (m Map) IsNull() bool
- func (m Map) Keys() []string
- func (m Map) Merge(src Map) Map
- func (m *Map) Replace(src Clonable) (Clonable, error)
- func (m Map) Values() []interface{}
- type NullValue
- type Serializable
- type Validatable
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
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 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
type IndexedListOfStrings ¶
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 ¶
NewKeyValue creates a new mutable Key/Value
type Map ¶
type Map map[string]interface{}
Map ...
func (Map) ForceMerge ¶
ForceMerge adds missing keys from source in p and replace the ones in source already in p
type NullValue ¶ added in v21.11.1
type NullValue interface {
IsNull() bool // Tells if the underlying instance is a Null Value
}
NullValue ...
type Serializable ¶
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