lock

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// This order equals a priority of operation
	OP_TYPE_READ uint8 = iota + 1
	OP_TYPE_WRITE
)
View Source
const (
	MainStorePrefix uint8 = iota
	TxStorePrefix
	LockStorePrefix
)

Variables

This section is empty.

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

func RegisterOPCodec

func RegisterOPCodec(cdc *codec.Codec)

Types

type LockOP added in v0.0.3

type LockOP interface {
	cross.OP

	Key() []byte
	ApplyTo(sdk.KVStore)
}

type OP

type OP interface {
	cross.OP

	Key() []byte
	Type() uint8
}

type OPManager

type OPManager interface {
	AddRead(key, value []byte)
	AddWrite(key, value []byte)
	GetUpdatedValue(key []byte) ([]byte, bool)
	OPs() cross.OPs
	LockOPs() []LockOP
}

func GetOPManager added in v0.0.3

func GetOPManager(tp cross.StateConstraintType) (OPManager, error)

type ReadOP

type ReadOP struct {
	K []byte
	V []byte
}

func (ReadOP) Equal added in v0.0.3

func (r ReadOP) Equal(cop cross.OP) bool

func (ReadOP) Key added in v0.0.3

func (r ReadOP) Key() []byte

func (ReadOP) String added in v0.0.3

func (r ReadOP) String() string

func (ReadOP) Type added in v0.0.3

func (r ReadOP) Type() uint8

func (ReadOP) Value added in v0.0.3

func (r ReadOP) Value() []byte

type Store

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

func NewStore

func NewStore(kvs sdk.KVStore, tp cross.StateConstraintType) Store

func (Store) Commit

func (s Store) Commit(id []byte) error

func (Store) CommitImmediately

func (s Store) CommitImmediately() error

func (Store) Delete

func (s Store) Delete(key []byte)

func (Store) Discard

func (s Store) Discard(id []byte) error

func (Store) Get

func (s Store) Get(key []byte) []byte

func (Store) Has

func (s Store) Has(key []byte) bool

func (Store) OPs

func (s Store) OPs() cross.OPs

func (Store) Precommit

func (s Store) Precommit(id []byte) error

func (Store) Set

func (s Store) Set(key, value []byte)

type WriteOP

type WriteOP struct {
	K []byte
	V []byte
}

func (WriteOP) ApplyTo added in v0.0.3

func (w WriteOP) ApplyTo(kvs sdk.KVStore)

func (WriteOP) Equal added in v0.0.3

func (w WriteOP) Equal(cop cross.OP) bool

func (WriteOP) Key added in v0.0.3

func (w WriteOP) Key() []byte

func (WriteOP) String added in v0.0.3

func (w WriteOP) String() string

func (WriteOP) Type added in v0.0.3

func (w WriteOP) Type() uint8

func (WriteOP) Value

func (w WriteOP) Value() []byte

Jump to

Keyboard shortcuts

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