fabric: github.com/hyperledger/fabric/core/chaincode/platforms/ccmetadata Index | Files

package ccmetadata

import "github.com/hyperledger/fabric/core/chaincode/platforms/ccmetadata"

# Copyright State Street Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0


Package Files

ccmetadata.go targzmetadataprovider.go validators.go


const AllowedCharsCollectionName = "[A-Za-z0-9_-]+"

AllowedCharsCollectionName captures the regex pattern for a valid collection name

func ValidateMetadataFile Uses

func ValidateMetadataFile(filePathName string, fileBytes []byte) error

ValidateMetadataFile checks that metadata files are valid according to the validation rules of the file's directory

type InvalidIndexContentError Uses

type InvalidIndexContentError struct {
    // contains filtered or unexported fields

InvalidIndexContentError is returned for metadata files with invalid content

func (*InvalidIndexContentError) Error Uses

func (e *InvalidIndexContentError) Error() string

type MetadataProvider Uses

type MetadataProvider interface {
    GetMetadataAsTarEntries() ([]byte, error)

MetadataProvider is implemented by each platform in a platform specific manner. It can process metadata stored in ChaincodeDeploymentSpec in different formats. The common format is targz. Currently users expect the metadata to be presented as tar file entries (directly extracted from chaincode stored in targz format). In future, we would like provide better abstraction by extending the interface

type TargzMetadataProvider Uses

type TargzMetadataProvider struct {
    Code []byte

TargzMetadataProvider provides Metadata from chaincode packaged in Targz format (go, java and node platforms)

func (*TargzMetadataProvider) GetMetadataAsTarEntries Uses

func (tgzProv *TargzMetadataProvider) GetMetadataAsTarEntries() ([]byte, error)

GetMetadataAsTarEntries extracts metata data from ChaincodeDeploymentSpec

type UnhandledDirectoryError Uses

type UnhandledDirectoryError struct {
    // contains filtered or unexported fields

UnhandledDirectoryError is returned for metadata files in unhandled directories

func (*UnhandledDirectoryError) Error Uses

func (e *UnhandledDirectoryError) Error() string

Package ccmetadata imports 12 packages (graph) and is imported by 7 packages. Updated 2019-01-02. Refresh now. Tools for package owners.