Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection interface { // CollectionID returns this collection's ID CollectionID() string // MemberOrgs returns the collection's members as MSP IDs. This serves as // a human-readable way of quickly identifying who is part of a collection. MemberOrgs() []string }
Collection defines a common interface for collections
type CollectionAccessPolicy ¶
type CollectionAccessPolicy interface { // AccessFilter returns a member filter function for a collection AccessFilter() Filter // RequiredPeerCount returns the minimum number of peers // required to send private data to RequiredPeerCount() int // MemberOrgs returns the collection's members as MSP IDs. This serves as // a human-readable way of quickly identifying who is part of a collection. MemberOrgs() []string }
CollectionAccessPolicy encapsulates functions for the access policy of a collection
type CollectionStore ¶
type CollectionStore interface { // GetCollection retrieves the collection in the following way: // If the TxID exists in the ledger, the collection that is returned has the // latest configuration that was committed into the ledger before this txID // was committed. // Else - it's the latest configuration for the collection. RetrieveCollection(common.CollectionCriteria) (Collection, error) // GetCollectionAccessPolicy retrieves a collection's access policy RetrieveCollectionAccessPolicy(common.CollectionCriteria) (CollectionAccessPolicy, error) }
CollectionStore retrieves stored collections based on the collection's properties. It works as a collection object factory and takes care of returning a collection object of an appropriate collection type.
func NewSimpleCollectionStore ¶
func NewSimpleCollectionStore(s Support) CollectionStore
NewSimpleCollectionStore returns a collection stored backed by a ledger supplied by the specified ledgerGetter with an internal name formed as specified by the supplied collectionNamer function
type Filter ¶
type Filter func(common.SignedData) bool
Filter defines a rule that filters peers according to data signed by them. The Identity in the SignedData is a SerializedIdentity of a peer. The Data is a message the peer signed, and the Signature is the corresponding Signature on that Data. Returns: True, if the policy holds for the given signed data.
False otherwise
type NoSuchCollectionError ¶
type NoSuchCollectionError common.CollectionCriteria
func (NoSuchCollectionError) Error ¶
func (f NoSuchCollectionError) Error() string
type NopCollection ¶
type NopCollection struct { }
NopCollection implements an allow-all collection which all orgs are a member of
func (*NopCollection) AccessFilter ¶
func (nc *NopCollection) AccessFilter() Filter
func (*NopCollection) CollectionID ¶
func (nc *NopCollection) CollectionID() string
func (*NopCollection) MemberOrgs ¶
func (nc *NopCollection) MemberOrgs() []string
func (*NopCollection) RequiredPeerCount ¶
func (nc *NopCollection) RequiredPeerCount() int
type NopCollectionStore ¶
type NopCollectionStore struct { }
func (*NopCollectionStore) RetrieveCollection ¶
func (*NopCollectionStore) RetrieveCollection(common.CollectionCriteria) (Collection, error)
func (*NopCollectionStore) RetrieveCollectionAccessPolicy ¶
func (*NopCollectionStore) RetrieveCollectionAccessPolicy(common.CollectionCriteria) (CollectionAccessPolicy, error)
type SimpleCollection ¶
type SimpleCollection struct {
// contains filtered or unexported fields
}
SimpleCollection implements a collection with static properties and a public member set
func (*SimpleCollection) AccessFilter ¶
func (sc *SimpleCollection) AccessFilter() Filter
AccessFilter returns the member filter function that evaluates signed data against the member access policy of this collection
func (*SimpleCollection) CollectionID ¶
func (sc *SimpleCollection) CollectionID() string
CollectionID returns the collection's ID
func (*SimpleCollection) MemberOrgs ¶
func (sc *SimpleCollection) MemberOrgs() []string
MemberOrgs returns the MSP IDs that are part of this collection
func (*SimpleCollection) RequiredPeerCount ¶
func (sc *SimpleCollection) RequiredPeerCount() int
RequiredPeerCount returns the minimum number of peers required to send private data to
func (*SimpleCollection) Setup ¶
func (sc *SimpleCollection) Setup(collectionConfig *common.StaticCollectionConfig, deserializer msp.IdentityDeserializer) error
Setup configures a simple collection object based on a given StaticCollectionConfig proto that has all the necessary information
type Support ¶
type Support interface { // GetQueryExecutorForLedger returns a query executor for the specified channel GetQueryExecutorForLedger(cid string) (ledger.QueryExecutor, error) // GetCollectionKVSKey returns the name of the collection // given the collection criteria GetCollectionKVSKey(cc common.CollectionCriteria) string // GetIdentityDeserializer returns an IdentityDeserializer // instance for the specified chain GetIdentityDeserializer(chainID string) msp.IdentityDeserializer }
Support is an interface used to inject dependencies