ccmetadata

package
v0.0.0-...-6f64d5f Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

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

Index

Constants

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

AllowedCharsCollectionName captures the regex pattern for a valid collection name

Variables

This section is empty.

Functions

func ValidateMetadataFile

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

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

Types

type InvalidIndexContentError

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

InvalidIndexContentError is returned for metadata files with invalid content

func (*InvalidIndexContentError) Error

func (e *InvalidIndexContentError) Error() string

type MetadataProvider

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

type TargzMetadataProvider struct {
	DepSpec *pb.ChaincodeDeploymentSpec
}

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

func (*TargzMetadataProvider) GetMetadataAsTarEntries

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

GetMetadataAsTarEntries extracts metata data from ChaincodeDeploymentSpec

type UnhandledDirectoryError

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

UnhandledDirectoryError is returned for metadata files in unhandled directories

func (*UnhandledDirectoryError) Error

func (e *UnhandledDirectoryError) Error() string

Jump to

Keyboard shortcuts

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