Documentation ¶
Index ¶
- Constants
- Variables
- func CCFileName(packageID string) string
- type ChaincodePackage
- type ChaincodePackageLocator
- type ChaincodePackageMetadata
- type ChaincodePackageParser
- type ChaincodePackageStreamer
- type CodePackageNotFoundErr
- type FallbackPackageLocator
- type FilesystemIO
- func (*FilesystemIO) Exists(path string) (bool, error)
- func (f *FilesystemIO) MakeDir(dirname string, mode os.FileMode) error
- func (f *FilesystemIO) ReadDir(dirname string) ([]os.FileInfo, error)
- func (f *FilesystemIO) ReadFile(filename string) ([]byte, error)
- func (f *FilesystemIO) Remove(name string) error
- func (f *FilesystemIO) WriteFile(path, name string, data []byte) error
- type IOReadWriter
- type LegacyCCPackageLocator
- type LegacyPackageProvider
- type MetadataProvider
- type PackageProvider
- type Store
- type TarFileStream
Constants ¶
View Source
const ( MetadataFile = "metadata.json" CodePackageFile = "code.tar.gz" )
Variables ¶
View Source
var (
LabelRegexp = regexp.MustCompile("^[a-zA-Z0-9]+([.+-_][a-zA-Z0-9]+)*$")
)
Functions ¶
func CCFileName ¶
Types ¶
type ChaincodePackage ¶
type ChaincodePackage struct { Metadata *ChaincodePackageMetadata CodePackage []byte DBArtifacts []byte }
type ChaincodePackageLocator ¶
type ChaincodePackageLocator struct {
ChaincodeDir string
}
func (*ChaincodePackageLocator) ChaincodePackageStreamer ¶
func (cpl *ChaincodePackageLocator) ChaincodePackageStreamer(packageID string) *ChaincodePackageStreamer
type ChaincodePackageParser ¶
type ChaincodePackageParser struct {
MetadataProvider MetadataProvider
}
func (ChaincodePackageParser) Parse ¶
func (ccpp ChaincodePackageParser) Parse(source []byte) (*ChaincodePackage, error)
type ChaincodePackageStreamer ¶
type ChaincodePackageStreamer struct {
PackagePath string
}
func (*ChaincodePackageStreamer) Code ¶
func (cps *ChaincodePackageStreamer) Code() (*TarFileStream, error)
func (*ChaincodePackageStreamer) Exists ¶
func (cps *ChaincodePackageStreamer) Exists() bool
func (*ChaincodePackageStreamer) File ¶
func (cps *ChaincodePackageStreamer) File(name string) (tarFileStream *TarFileStream, err error)
func (*ChaincodePackageStreamer) Metadata ¶
func (cps *ChaincodePackageStreamer) Metadata() (*ChaincodePackageMetadata, error)
type CodePackageNotFoundErr ¶
type CodePackageNotFoundErr struct {
PackageID string
}
func (CodePackageNotFoundErr) Error ¶
func (e CodePackageNotFoundErr) Error() string
type FallbackPackageLocator ¶
type FallbackPackageLocator struct { ChaincodePackageLocator *ChaincodePackageLocator LegacyCCPackageLocator LegacyCCPackageLocator }
func (*FallbackPackageLocator) GetChaincodePackage ¶
func (fpl *FallbackPackageLocator) GetChaincodePackage(packageID string) (*ChaincodePackageMetadata, io.ReadCloser, error)
type FilesystemIO ¶
type FilesystemIO struct { }
func (*FilesystemIO) MakeDir ¶
func (f *FilesystemIO) MakeDir(dirname string, mode os.FileMode) error
func (*FilesystemIO) ReadDir ¶
func (f *FilesystemIO) ReadDir(dirname string) ([]os.FileInfo, error)
func (*FilesystemIO) Remove ¶
func (f *FilesystemIO) Remove(name string) error
type IOReadWriter ¶
type LegacyCCPackageLocator ¶
type LegacyCCPackageLocator interface {
GetChaincodeDepSpec(nameVersion string) (*pb.ChaincodeDeploymentSpec, error)
}
type LegacyPackageProvider ¶
type LegacyPackageProvider interface { GetChaincodeInstallPath() string ListInstalledChaincodes(dir string, de ccprovider.DirEnumerator, ce ccprovider.ChaincodeExtractor) ([]chaincode.InstalledChaincode, error) }
type MetadataProvider ¶
type PackageProvider ¶
type PackageProvider struct {
LegacyPP LegacyPackageProvider
}
func (*PackageProvider) ListInstalledChaincodesLegacy ¶
func (p *PackageProvider) ListInstalledChaincodesLegacy() ([]chaincode.InstalledChaincode, error)
type Store ¶
type Store struct { Path string ReadWriter IOReadWriter }
func (*Store) GetChaincodeInstallPath ¶
func (*Store) Initialize ¶
func (s *Store) Initialize()
func (*Store) ListInstalledChaincodes ¶
func (s *Store) ListInstalledChaincodes() ([]chaincode.InstalledChaincode, error)
Click to show internal directories.
Click to hide internal directories.