{"modulePath":"github.com/CS-SI/SafeScale/v21","version":"v21.11.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package serialize\n\n## Variables\n\n```go\nvar PropertyTypeRegistry = struct{ propertyTypeRegistry }{/* contains filtered or unexported fields */}\n```\nPropertyTypeRegistry ...\n\n## Types\n\n```go\ntype JSONProperties struct {\n\t// properties jsonProperties\n\tProperties map[string]*jsonProperty\n\t// This lock is used to make sure addition or removal of keys in JSonProperties won't collide in go routines\n\tsync.RWMutex\n\t// contains filtered or unexported fields\n}\n```\nJSONProperties ...\n\n```go\nfunc NewJSONProperties(module string) (_ *JSONProperties, ferr fail.Error)\n```\nNewJSONProperties creates a new JSonProperties instance\n\n```go\nfunc (x *JSONProperties) Alter(key string, alterer func(data.Clonable) fail.Error) (ferr fail.Error)\n```\nAlter 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().\n\n```go\nfunc (x *JSONProperties) Count() uint\n```\nCount returns the number of properties available\n\n```go\nfunc (x *JSONProperties) Deserialize(buf []byte) (ferr fail.Error)\n```\nDeserialize ... Returns fail.SyntaxError if an JSON syntax error happens satisfies interface data.Serializable\n\n```go\nfunc (x *JSONProperties) Inspect(key string, inspector func(clonable data.Clonable) fail.Error) (ferr fail.Error)\n```\nInspect allows to consult the content of the property 'key' inside 'inspector' function Changes in the property won't be kept\n\n```go\nfunc (x *JSONProperties) Lookup(key string) bool\n```\nLookup tells if a key is present in JSonProperties\n\n```go\nfunc (x *JSONProperties) Serialize() (_ []byte, ferr fail.Error)\n```\nSerialize ... satisfies interface data.Serializable\n\n```go\nfunc (x *JSONProperties) SetModule(module string) (ferr fail.Error)\n```\nSetModule allows to change the module of the JSONProperties (used to \"contextualize\" Property Types)\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","path":"github.com/CS-SI/SafeScale/v21/lib/utils/data/serialize","name":"serialize","synopsis":"","isRedistributable":true}
