serialize

package
v22.11.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Sdump

func (x *JSONProperties) Sdump() (string, fail.Error)

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

type JSONProperty struct {
	*shielded.Shielded
	// contains filtered or unexported fields
}

JSONProperty contains data and a RWMutex to handle sync

func (JSONProperty) Clone

func (jp JSONProperty) Clone() (data.Clonable, error)

func (*JSONProperty) IsNull

func (jp *JSONProperty) IsNull() bool

IsNull tells if the JSONProperty is a Null Value

func (*JSONProperty) Replace

func (jp *JSONProperty) Replace(clonable data.Clonable) (data.Clonable, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL