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

package platforms

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

Index

Package Files

platforms.go

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 PackageWriter Uses

type PackageWriter interface {
    Write(name string, payload []byte, tw *tar.Writer) error
}

type PackageWriterWrapper Uses

type PackageWriterWrapper func(name string, payload []byte, tw *tar.Writer) error

func (PackageWriterWrapper) Write Uses

func (pw PackageWriterWrapper) Write(name string, payload []byte, tw *tar.Writer) error

type Platform Uses

type Platform interface {
    Name() string
    ValidatePath(path string) error
    ValidateCodePackage(code []byte) error
    GetDeploymentPayload(path string) ([]byte, error)
    GenerateDockerfile() (string, error)
    GenerateDockerBuild(path string, code []byte, tw *tar.Writer) error
    GetMetadataProvider(code []byte) MetadataProvider
}

Interface for validating the specification and and writing the package for the given platform

type Registry Uses

type Registry struct {
    Platforms     map[string]Platform
    PackageWriter PackageWriter
}

func NewRegistry Uses

func NewRegistry(platformTypes ...Platform) *Registry

func (*Registry) GenerateDockerBuild Uses

func (r *Registry) GenerateDockerBuild(ccType, path, name, version string, codePackage []byte) (io.Reader, error)

func (*Registry) GenerateDockerfile Uses

func (r *Registry) GenerateDockerfile(ccType, name, version string) (string, error)

func (*Registry) GetDeploymentPayload Uses

func (r *Registry) GetDeploymentPayload(ccType, path string) ([]byte, error)

func (*Registry) GetMetadataProvider Uses

func (r *Registry) GetMetadataProvider(ccType string, codePackage []byte) (MetadataProvider, error)

func (*Registry) StreamDockerBuild Uses

func (r *Registry) StreamDockerBuild(ccType, path string, codePackage []byte, inputFiles map[string][]byte, tw *tar.Writer) error

func (*Registry) ValidateDeploymentSpec Uses

func (r *Registry) ValidateDeploymentSpec(ccType string, codePackage []byte) error

func (*Registry) ValidateSpec Uses

func (r *Registry) ValidateSpec(ccType, path string) error

Directories

PathSynopsis
car
ccmetadata
golang
java
mockCode generated by counterfeiter.
node
util

Package platforms imports 8 packages (graph) and is imported by 87 packages. Updated 2018-12-11. Refresh now. Tools for package owners.