privacyenabledstate

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonStorageDB

type CommonStorageDB struct {
	statedb.VersionedDB
	// contains filtered or unexported fields
}

func (*CommonStorageDB) ApplyPrivacyAwareUpdates

func (s *CommonStorageDB) ApplyPrivacyAwareUpdates(updates *UpdateBatch, height *version.Height) error

func (*CommonStorageDB) ApplyUpdates

func (s *CommonStorageDB) ApplyUpdates(batch *statedb.UpdateBatch, height *version.Height) error

func (*CommonStorageDB) ChaincodeDeployDone

func (s *CommonStorageDB) ChaincodeDeployDone(succeeded bool)

func (*CommonStorageDB) ClearCachedVersions

func (s *CommonStorageDB) ClearCachedVersions()

func (CommonStorageDB) ExecuteQueryOnPrivateData

func (s CommonStorageDB) ExecuteQueryOnPrivateData(namespace, collection, query string) (statedb.ResultsIterator, error)

func (*CommonStorageDB) GetCachedKeyHashVersion

func (s *CommonStorageDB) GetCachedKeyHashVersion(namespace, collection string, keyHash []byte) (*version.Height, bool)

func (*CommonStorageDB) GetChaincodeEventListener

func (s *CommonStorageDB) GetChaincodeEventListener() cceventmgmt.ChaincodeLifecycleEventListener

func (*CommonStorageDB) GetKeyHashVersion

func (s *CommonStorageDB) GetKeyHashVersion(namespace, collection string, keyHash []byte) (*version.Height, error)

func (*CommonStorageDB) GetPrivateData

func (s *CommonStorageDB) GetPrivateData(namespace, collection, key string) (*statedb.VersionedValue, error)

func (*CommonStorageDB) GetPrivateDataHash

func (s *CommonStorageDB) GetPrivateDataHash(namespace, collection, key string) (*statedb.VersionedValue, error)

func (*CommonStorageDB) GetPrivateDataMetadataByHash

func (s *CommonStorageDB) GetPrivateDataMetadataByHash(namespace, collection string, keyHash []byte) ([]byte, error)

func (*CommonStorageDB) GetPrivateDataMultipleKeys

func (s *CommonStorageDB) GetPrivateDataMultipleKeys(namespace, collection string, keys []string) ([]*statedb.VersionedValue, error)

func (*CommonStorageDB) GetPrivateDataRangeScanIterator

func (s *CommonStorageDB) GetPrivateDataRangeScanIterator(namespace, collection, startKey, endKey string) (statedb.ResultsIterator, error)

func (*CommonStorageDB) GetStateMetadata

func (s *CommonStorageDB) GetStateMetadata(namespace, key string) ([]byte, error)

func (*CommonStorageDB) GetValueHash

func (s *CommonStorageDB) GetValueHash(namespace, collection string, keyHash []byte) (*statedb.VersionedValue, error)

func (*CommonStorageDB) HandleChaincodeDeploy

func (s *CommonStorageDB) HandleChaincodeDeploy(chaincodeDefinition *cceventmgmt.ChaincodeDefinition, dbArtifactsTar []byte) error

func (*CommonStorageDB) IsBulkOptimizable

func (s *CommonStorageDB) IsBulkOptimizable() bool

func (*CommonStorageDB) LoadCommittedVersionsOfPubAndHashedKeys

func (s *CommonStorageDB) LoadCommittedVersionsOfPubAndHashedKeys(pubKeys []*statedb.CompositeKey,
	hashedKeys []*HashedCompositeKey) error

type CommonStorageDBProvider

type CommonStorageDBProvider struct {
	statedb.VersionedDBProvider
	HealthCheckRegistry ledger.HealthCheckRegistry
	// contains filtered or unexported fields
}

func (*CommonStorageDBProvider) Close

func (p *CommonStorageDBProvider) Close()

func (*CommonStorageDBProvider) GetDBHandle

func (p *CommonStorageDBProvider) GetDBHandle(id string) (DB, error)

func (*CommonStorageDBProvider) RegisterHealthChecker

func (p *CommonStorageDBProvider) RegisterHealthChecker() error

type CouchDBCommonStorageTestEnv

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

func (*CouchDBCommonStorageTestEnv) Cleanup

func (env *CouchDBCommonStorageTestEnv) Cleanup()

func (*CouchDBCommonStorageTestEnv) GetDBHandle

func (env *CouchDBCommonStorageTestEnv) GetDBHandle(id string) DB

func (*CouchDBCommonStorageTestEnv) GetName

func (env *CouchDBCommonStorageTestEnv) GetName() string

func (*CouchDBCommonStorageTestEnv) Init

func (env *CouchDBCommonStorageTestEnv) Init(t testing.TB)

type DB

type DB interface {
	statedb.VersionedDB
	IsBulkOptimizable() bool
	LoadCommittedVersionsOfPubAndHashedKeys(pubKeys []*statedb.CompositeKey, hashedKeys []*HashedCompositeKey) error
	GetCachedKeyHashVersion(namespace, collection string, keyHash []byte) (*version.Height, bool)
	ClearCachedVersions()
	GetChaincodeEventListener() cceventmgmt.ChaincodeLifecycleEventListener
	GetPrivateData(namespace, collection, key string) (*statedb.VersionedValue, error)
	GetPrivateDataHash(namespace, collection, key string) (*statedb.VersionedValue, error)
	GetValueHash(namespace, collection string, keyHash []byte) (*statedb.VersionedValue, error)
	GetKeyHashVersion(namespace, collection string, keyHash []byte) (*version.Height, error)
	GetPrivateDataMultipleKeys(namespace, collection string, keys []string) ([]*statedb.VersionedValue, error)
	GetPrivateDataRangeScanIterator(namespace, collection, startKey, endKey string) (statedb.ResultsIterator, error)
	GetStateMetadata(namespace, key string) ([]byte, error)
	GetPrivateDataMetadataByHash(namespace, collection string, keyHash []byte) ([]byte, error)
	ExecuteQueryOnPrivateData(namespace, collection, query string) (statedb.ResultsIterator, error)
	ApplyPrivacyAwareUpdates(updates *UpdateBatch, height *version.Height) error
}

func NewCommonStorageDB

func NewCommonStorageDB(vdb statedb.VersionedDB, ledgerid string, metadataHint *metadataHint) (DB, error)

type DBProvider

type DBProvider interface {
	GetDBHandle(id string) (DB, error)

	Close()
}

func NewCommonStorageDBProvider

func NewCommonStorageDBProvider(
	bookkeeperProvider bookkeeping.Provider,
	metricsProvider metrics.Provider,
	healthCheckRegistry ledger.HealthCheckRegistry,
	stateDBConf *StateDBConfig,
) (DBProvider, error)

type HashedCompositeKey

type HashedCompositeKey struct {
	Namespace      string
	CollectionName string
	KeyHash        string
}

func (*HashedCompositeKey) String

func (hck *HashedCompositeKey) String() string

type HashedUpdateBatch

type HashedUpdateBatch struct {
	UpdateMap
}

func NewHashedUpdateBatch

func NewHashedUpdateBatch() *HashedUpdateBatch

func (HashedUpdateBatch) Contains

func (h HashedUpdateBatch) Contains(ns, coll string, keyHash []byte) bool

func (HashedUpdateBatch) Delete

func (h HashedUpdateBatch) Delete(ns, coll string, key []byte, version *version.Height)

func (HashedUpdateBatch) Put

func (h HashedUpdateBatch) Put(ns, coll string, key []byte, value []byte, version *version.Height)

func (HashedUpdateBatch) PutValHashAndMetadata

func (h HashedUpdateBatch) PutValHashAndMetadata(ns, coll string, key []byte, value []byte, metadata []byte, version *version.Height)

func (HashedUpdateBatch) ToCompositeKeyMap

func (h HashedUpdateBatch) ToCompositeKeyMap() map[HashedCompositeKey]*statedb.VersionedValue

type KVWriteProto

type KVWriteProto struct {
	Namespace            string   `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Collection           string   `protobuf:"bytes,2,opt,name=collection,proto3" json:"collection,omitempty"`
	Key                  []byte   `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
	IsDelete             bool     `protobuf:"varint,4,opt,name=isDelete,proto3" json:"isDelete,omitempty"`
	Value                []byte   `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
	VersionBytes         []byte   `protobuf:"bytes,6,opt,name=version_bytes,json=versionBytes,proto3" json:"version_bytes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*KVWriteProto) Descriptor

func (*KVWriteProto) Descriptor() ([]byte, []int)

func (*KVWriteProto) GetCollection

func (m *KVWriteProto) GetCollection() string

func (*KVWriteProto) GetIsDelete

func (m *KVWriteProto) GetIsDelete() bool

func (*KVWriteProto) GetKey

func (m *KVWriteProto) GetKey() []byte

func (*KVWriteProto) GetNamespace

func (m *KVWriteProto) GetNamespace() string

func (*KVWriteProto) GetValue

func (m *KVWriteProto) GetValue() []byte

func (*KVWriteProto) GetVersionBytes

func (m *KVWriteProto) GetVersionBytes() []byte

func (*KVWriteProto) ProtoMessage

func (*KVWriteProto) ProtoMessage()

func (*KVWriteProto) Reset

func (m *KVWriteProto) Reset()

func (*KVWriteProto) String

func (m *KVWriteProto) String() string

func (*KVWriteProto) XXX_DiscardUnknown

func (m *KVWriteProto) XXX_DiscardUnknown()

func (*KVWriteProto) XXX_Marshal

func (m *KVWriteProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KVWriteProto) XXX_Merge

func (m *KVWriteProto) XXX_Merge(src proto.Message)

func (*KVWriteProto) XXX_Size

func (m *KVWriteProto) XXX_Size() int

func (*KVWriteProto) XXX_Unmarshal

func (m *KVWriteProto) XXX_Unmarshal(b []byte) error

type KVWritesBatchProto

type KVWritesBatchProto struct {
	Kvwrites             []*KVWriteProto `protobuf:"bytes,1,rep,name=kvwrites,proto3" json:"kvwrites,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*KVWritesBatchProto) Descriptor

func (*KVWritesBatchProto) Descriptor() ([]byte, []int)

func (*KVWritesBatchProto) GetKvwrites

func (m *KVWritesBatchProto) GetKvwrites() []*KVWriteProto

func (*KVWritesBatchProto) ProtoMessage

func (*KVWritesBatchProto) ProtoMessage()

func (*KVWritesBatchProto) Reset

func (m *KVWritesBatchProto) Reset()

func (*KVWritesBatchProto) String

func (m *KVWritesBatchProto) String() string

func (*KVWritesBatchProto) XXX_DiscardUnknown

func (m *KVWritesBatchProto) XXX_DiscardUnknown()

func (*KVWritesBatchProto) XXX_Marshal

func (m *KVWritesBatchProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*KVWritesBatchProto) XXX_Merge

func (m *KVWritesBatchProto) XXX_Merge(src proto.Message)

func (*KVWritesBatchProto) XXX_Size

func (m *KVWritesBatchProto) XXX_Size() int

func (*KVWritesBatchProto) XXX_Unmarshal

func (m *KVWritesBatchProto) XXX_Unmarshal(b []byte) error

type LevelDBCommonStorageTestEnv

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

func (*LevelDBCommonStorageTestEnv) Cleanup

func (env *LevelDBCommonStorageTestEnv) Cleanup()

func (*LevelDBCommonStorageTestEnv) GetDBHandle

func (env *LevelDBCommonStorageTestEnv) GetDBHandle(id string) DB

func (*LevelDBCommonStorageTestEnv) GetName

func (env *LevelDBCommonStorageTestEnv) GetName() string

func (*LevelDBCommonStorageTestEnv) Init

func (env *LevelDBCommonStorageTestEnv) Init(t testing.TB)

type PubUpdateBatch

type PubUpdateBatch struct {
	*statedb.UpdateBatch
}

func NewPubUpdateBatch

func NewPubUpdateBatch() *PubUpdateBatch

type PvtKVWrite

type PvtKVWrite struct {
	Key      string
	IsDelete bool
	Value    []byte
	Version  *version.Height
}

type PvtUpdateBatch

type PvtUpdateBatch struct {
	UpdateMap
}

func NewPvtUpdateBatch

func NewPvtUpdateBatch() *PvtUpdateBatch

func (PvtUpdateBatch) ToCompositeKeyMap

func (p PvtUpdateBatch) ToCompositeKeyMap() PvtdataCompositeKeyMap

type PvtdataCompositeKey

type PvtdataCompositeKey struct {
	Namespace      string
	CollectionName string
	Key            string
}

type PvtdataCompositeKeyMap

type PvtdataCompositeKeyMap map[PvtdataCompositeKey]*statedb.VersionedValue

type StateDBConfig

type StateDBConfig struct {
	*ledger.StateDBConfig

	LevelDBPath string
}

type TestEnv

type TestEnv interface {
	Init(t testing.TB)
	GetDBHandle(id string) DB
	GetName() string
	Cleanup()
}

type UpdateBatch

type UpdateBatch struct {
	PubUpdates  *PubUpdateBatch
	HashUpdates *HashedUpdateBatch
	PvtUpdates  *PvtUpdateBatch
}

func NewUpdateBatch

func NewUpdateBatch() *UpdateBatch

type UpdateMap

type UpdateMap map[string]nsBatch

func (UpdateMap) Contains

func (b UpdateMap) Contains(ns, coll, key string) bool

func (UpdateMap) Delete

func (b UpdateMap) Delete(ns, coll, key string, version *version.Height)

func (UpdateMap) Get

func (b UpdateMap) Get(ns, coll, key string) *statedb.VersionedValue

func (UpdateMap) IsEmpty

func (b UpdateMap) IsEmpty() bool

func (UpdateMap) Put

func (b UpdateMap) Put(ns, coll, key string, value []byte, version *version.Height)

func (UpdateMap) PutValAndMetadata

func (b UpdateMap) PutValAndMetadata(ns, coll, key string, value []byte, metadata []byte, version *version.Height)

type UpdatesBytesBuilder

type UpdatesBytesBuilder struct {
}

func (*UpdatesBytesBuilder) DeterministicBytesForPubAndHashUpdates

func (bb *UpdatesBytesBuilder) DeterministicBytesForPubAndHashUpdates(u *UpdateBatch) ([]byte, error)

Jump to

Keyboard shortcuts

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