shielded

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shielded

type Shielded struct {
	// contains filtered or unexported fields
}

Shielded allows to store data with controlled access to it

func NewShielded

func NewShielded(witness data.Clonable) (*Shielded, error)

NewShielded creates a new protected data from a cloned witness

func (*Shielded) Alter

func (instance *Shielded) Alter(alterer func(data.Clonable) fail.Error) (ferr fail.Error)

Alter allows to update a cloneable using a write lock 'alterer' can use a special error to tell the outside there was no change : fail.ErrAlteredNothing, which can be generated with fail.AlteredNothingError(). The caller of the Alter() method will then be able to known, when an error occurs, if it's because there was no change.

func (*Shielded) Clone

func (instance *Shielded) Clone() (*Shielded, error)

Clone ...

func (*Shielded) Deserialize

func (instance *Shielded) Deserialize(buf []byte) (ferr fail.Error)

Deserialize transforms serialization data to valid content of Shielded instance

func (*Shielded) Inspect

func (instance *Shielded) Inspect(inspector func(clonable data.Clonable) fail.Error) (ferr fail.Error)

Inspect is used to lock a clonable for read

func (*Shielded) IsNull

func (instance *Shielded) IsNull() bool

IsNull ... satisfies interface data.Clonable

func (*Shielded) RollBack added in v22.11.1

func (instance *Shielded) RollBack(in data.Clonable) error

func (*Shielded) Sdump

func (instance *Shielded) Sdump() (string, error)

func (*Shielded) Serialize

func (instance *Shielded) Serialize() (_ []byte, ferr fail.Error)

Serialize transforms content of Shielded instance to data suitable for serialization

func (*Shielded) UnWrap

func (instance *Shielded) UnWrap() (data.Clonable, error)

UnWrap is the fastest way to get a clone of the shielded data

Jump to

Keyboard shortcuts

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