shielded

package
v21.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

NewShielded creates a new protected data from a cloned witness

func (*Shielded) Alter

func (instance *Shielded) Alter(alterer func(data.Clonable) fail.Error) (xerr 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

Clone ...

func (*Shielded) Deserialize

func (instance *Shielded) Deserialize(buf []byte) (xerr 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) (xerr 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) Serialize

func (instance *Shielded) Serialize() (_ []byte, xerr 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