Documentation ¶
Index ¶
- Variables
- type JSONProperties
- func (x *JSONProperties) Alter(key string, alterer func(data.Clonable) fail.Error) (ferr fail.Error)
- func (x *JSONProperties) Clone() (*JSONProperties, error)
- func (x *JSONProperties) Count() uint
- func (x *JSONProperties) Deserialize(buf []byte) (ferr fail.Error)
- func (x *JSONProperties) Inspect(key string, inspector func(clonable data.Clonable) fail.Error) (ferr fail.Error)
- func (x *JSONProperties) Lookup(key string) bool
- func (x *JSONProperties) Sdump() (string, fail.Error)
- func (x *JSONProperties) Serialize() (_ []byte, ferr fail.Error)
- func (x *JSONProperties) SetModule(module string) (ferr fail.Error)
- func (x *JSONProperties) UnWrap() (map[string]*JSONProperty, error)
- type JSONProperty
Constants ¶
This section is empty.
Variables ¶
var PropertyTypeRegistry = struct{ propertyTypeRegistry }{/* contains filtered or unexported fields */}
PropertyTypeRegistry ...
Functions ¶
This section is empty.
Types ¶
type JSONProperties ¶
type JSONProperties struct { // properties jsonProperties Properties map[string]*JSONProperty // This lock is used to make sure addition or removal of keys in JSonProperties won't collide in go routines sync.RWMutex // contains filtered or unexported fields }
JSONProperties ...
func NewJSONProperties ¶
func NewJSONProperties(module string) (_ *JSONProperties, ferr fail.Error)
NewJSONProperties creates a new JSonProperties instance
func (*JSONProperties) Alter ¶
func (x *JSONProperties) Alter(key string, alterer func(data.Clonable) fail.Error) (ferr fail.Error)
Alter is used to lock an extension for write Returns a pointer to LockedEncodedExtension, on which can be applied method 'Use()' If no extension exists corresponding to the key, an empty one is created (in other words, this call can't fail because a key doesn't exist). 'alterer' can use a special error to tell the outside there was no change : fail.ErrAlteredNothing, which can be generated with fail.AlteredNothingError().
func (*JSONProperties) Clone ¶
func (x *JSONProperties) Clone() (*JSONProperties, error)
func (*JSONProperties) Count ¶
func (x *JSONProperties) Count() uint
Count returns the number of properties available
func (*JSONProperties) Deserialize ¶
func (x *JSONProperties) Deserialize(buf []byte) (ferr fail.Error)
Deserialize ... Returns fail.SyntaxError if an JSON syntax error happens satisfies interface data.Serializable
func (*JSONProperties) Inspect ¶
func (x *JSONProperties) Inspect(key string, inspector func(clonable data.Clonable) fail.Error) (ferr fail.Error)
Inspect allows to consult the content of the property 'key' inside 'inspector' function Changes in the property won't be kept
func (*JSONProperties) Lookup ¶
func (x *JSONProperties) Lookup(key string) bool
Lookup tells if a key is present in JSonProperties
func (*JSONProperties) Serialize ¶
func (x *JSONProperties) Serialize() (_ []byte, ferr fail.Error)
Serialize ... satisfies interface data.Serializable
func (*JSONProperties) SetModule ¶
func (x *JSONProperties) SetModule(module string) (ferr fail.Error)
SetModule allows to change the module of the JSONProperties (used to "contextualize" Property Types)
func (*JSONProperties) UnWrap ¶
func (x *JSONProperties) UnWrap() (map[string]*JSONProperty, error)
UnWrap is the fastest way to get a clone of the shielded data
type JSONProperty ¶
JSONProperty contains data and a RWMutex to handle sync
func (*JSONProperty) IsNull ¶
func (jp *JSONProperty) IsNull() bool
IsNull tells if the JSONProperty is a Null Value