pvtdatapolicy

package
v0.0.0-...-b544036 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeExpiringBlock

func ComputeExpiringBlock(namespace, collection string, committingBlock, btl uint64) uint64

Types

type BTLPolicy

type BTLPolicy interface {
	// GetBTL returns BlockToLive for a given namespace and collection
	GetBTL(ns string, coll string) (uint64, error)
	// GetExpiringBlock returns the block number by which the pvtdata for given namespace,collection, and committingBlock should expire
	GetExpiringBlock(namespace string, collection string, committingBlock uint64) (uint64, error)
}

BTLPolicy BlockToLive policy for the pvt data

func ConstructBTLPolicy

func ConstructBTLPolicy(collInfoProvider collectionInfoProvider) BTLPolicy

ConstructBTLPolicy constructs an instance of LSCCBasedBTLPolicy

type LSCCBasedBTLPolicy

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

LSCCBasedBTLPolicy implements interface BTLPolicy. This implementation loads the BTL policy from lscc namespace which is populated with the collection configuration during chaincode initialization

func (*LSCCBasedBTLPolicy) GetBTL

func (p *LSCCBasedBTLPolicy) GetBTL(namespace string, collection string) (uint64, error)

GetBTL implements corresponding function in interface `BTLPolicyMgr`

func (*LSCCBasedBTLPolicy) GetExpiringBlock

func (p *LSCCBasedBTLPolicy) GetExpiringBlock(namespace string, collection string, committingBlock uint64) (uint64, error)

GetExpiringBlock implements function from the interface `BTLPolicy`

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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