Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToMapStringOfString ¶
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 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 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 ¶
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