privdata

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCollectionKVSKey

func BuildCollectionKVSKey(ccname string) string

func GetCCNameFromCollectionConfigKey

func GetCCNameFromCollectionConfigKey(key string) string

func IsCollectionConfigKey

func IsCollectionConfigKey(key string) bool

func ParseCollectionConfig

func ParseCollectionConfig(colBytes []byte) (*common.CollectionConfigPackage, error)

func RetrieveCollectionConfigPackageFromState

func RetrieveCollectionConfigPackageFromState(cc common.CollectionCriteria, state State) (*common.CollectionConfigPackage, error)

Types

type ChaincodeInfoProvider

type ChaincodeInfoProvider interface {
	ChaincodeInfo(channelName, chaincodeName string, qe ledger.SimpleQueryExecutor) (*ledger.DeployedChaincodeInfo, error)

	CollectionInfo(channelName, chaincodeName, collectionName string, qe ledger.SimpleQueryExecutor) (*common.StaticCollectionConfig, error)
}

type Collection

type Collection interface {
	CollectionID() string

	MemberOrgs() []string
}

type CollectionAccessPolicy

type CollectionAccessPolicy interface {
	AccessFilter() Filter

	RequiredPeerCount() int

	MaximumPeerCount() int

	MemberOrgs() []string

	IsMemberOnlyRead() bool

	IsMemberOnlyWrite() bool
}

type CollectionFilter

type CollectionFilter interface {
	AccessFilter(channelName string, collectionPolicyConfig *common.CollectionPolicyConfig) (Filter, error)
}

type CollectionPersistenceConfigs

type CollectionPersistenceConfigs interface {
	BlockToLive() uint64
}

type CollectionStore

type CollectionStore interface {
	RetrieveCollection(common.CollectionCriteria) (Collection, error)

	RetrieveCollectionAccessPolicy(common.CollectionCriteria) (CollectionAccessPolicy, error)

	RetrieveCollectionConfigPackage(common.CollectionCriteria) (*common.CollectionConfigPackage, error)

	RetrieveCollectionPersistenceConfigs(common.CollectionCriteria) (CollectionPersistenceConfigs, error)

	RetrieveReadWritePermission(common.CollectionCriteria, *pb.SignedProposal, ledger.QueryExecutor) (bool, bool, error)

	CollectionFilter
}

type Filter

type Filter func(protoutil.SignedData) bool

type IdentityDeserializerFactory

type IdentityDeserializerFactory interface {
	GetIdentityDeserializer(chainID string) msp.IdentityDeserializer
}

type IdentityDeserializerFactoryFunc

type IdentityDeserializerFactoryFunc func(chainID string) msp.IdentityDeserializer

func (IdentityDeserializerFactoryFunc) GetIdentityDeserializer

func (i IdentityDeserializerFactoryFunc) GetIdentityDeserializer(chainID string) msp.IdentityDeserializer

type MembershipProvider

type MembershipProvider struct {
	IdentityDeserializerFactory func(chainID string) msp.IdentityDeserializer
	// contains filtered or unexported fields
}

func NewMembershipInfoProvider

func NewMembershipInfoProvider(selfSignedData protoutil.SignedData, identityDeserializerFunc func(chainID string) msp.IdentityDeserializer) *MembershipProvider

func (*MembershipProvider) AmMemberOf

func (m *MembershipProvider) AmMemberOf(channelName string, collectionPolicyConfig *common.CollectionPolicyConfig) (bool, error)

type NoSuchCollectionError

type NoSuchCollectionError common.CollectionCriteria

func (NoSuchCollectionError) Error

func (f NoSuchCollectionError) Error() string

type QueryExecutorFactory

type QueryExecutorFactory interface {
	NewQueryExecutor() (ledger.QueryExecutor, error)
}

type SimpleCollection

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

func NewSimpleCollection

func NewSimpleCollection(collectionConfig *common.StaticCollectionConfig, deserializer msp.IdentityDeserializer) (*SimpleCollection, error)

func (*SimpleCollection) AccessFilter

func (sc *SimpleCollection) AccessFilter() Filter

func (*SimpleCollection) CollectionID

func (sc *SimpleCollection) CollectionID() string

func (*SimpleCollection) IsMemberOnlyRead

func (sc *SimpleCollection) IsMemberOnlyRead() bool

func (*SimpleCollection) IsMemberOnlyWrite

func (sc *SimpleCollection) IsMemberOnlyWrite() bool

func (*SimpleCollection) MaximumPeerCount

func (sc *SimpleCollection) MaximumPeerCount() int

func (*SimpleCollection) MemberOrgs

func (sc *SimpleCollection) MemberOrgs() []string

func (*SimpleCollection) RequiredPeerCount

func (sc *SimpleCollection) RequiredPeerCount() int

func (*SimpleCollection) Setup

func (sc *SimpleCollection) Setup(collectionConfig *common.StaticCollectionConfig, deserializer msp.IdentityDeserializer) error

type SimpleCollectionPersistenceConfigs

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

func (*SimpleCollectionPersistenceConfigs) BlockToLive

func (s *SimpleCollectionPersistenceConfigs) BlockToLive() uint64

type SimpleCollectionStore

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

func NewSimpleCollectionStore

func NewSimpleCollectionStore(qeFactory QueryExecutorFactory, ccInfoProvider ChaincodeInfoProvider) *SimpleCollectionStore

func (*SimpleCollectionStore) AccessFilter

func (c *SimpleCollectionStore) AccessFilter(channelName string, collectionPolicyConfig *common.CollectionPolicyConfig) (Filter, error)

func (*SimpleCollectionStore) RetrieveCollection

func (c *SimpleCollectionStore) RetrieveCollection(cc common.CollectionCriteria) (Collection, error)

func (*SimpleCollectionStore) RetrieveCollectionAccessPolicy

func (c *SimpleCollectionStore) RetrieveCollectionAccessPolicy(cc common.CollectionCriteria) (CollectionAccessPolicy, error)

func (*SimpleCollectionStore) RetrieveCollectionConfigPackage

func (c *SimpleCollectionStore) RetrieveCollectionConfigPackage(cc common.CollectionCriteria) (*common.CollectionConfigPackage, error)

func (*SimpleCollectionStore) RetrieveCollectionPersistenceConfigs

func (c *SimpleCollectionStore) RetrieveCollectionPersistenceConfigs(cc common.CollectionCriteria) (CollectionPersistenceConfigs, error)

func (*SimpleCollectionStore) RetrieveReadWritePermission

func (c *SimpleCollectionStore) RetrieveReadWritePermission(
	cc common.CollectionCriteria,
	signedProposal *pb.SignedProposal,
	qe ledger.QueryExecutor,
) (bool, bool, error)

type State

type State interface {
	GetState(namespace string, key string) ([]byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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