shielded

package
v21.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 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 Note: doesn't follow interface data.Serializable (task parameter not used in it)

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) Sdump added in v21.11.1

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 Note: doesn't follow interface data.Serializable (task parameter not used in it)

Jump to

Keyboard shortcuts

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