platforms

package
v0.0.0-...-fbe82ab Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataProvider

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

MetadataProvider由每个平台以特定于平台的方式实现。 它可以处理以不同格式存储在chaincodedeploymentspec中的元数据。 通用格式是targz。当前用户希望显示元数据 作为tar文件条目(直接从以targz格式存储的链码中提取)。 将来,我们希望通过扩展接口来提供更好的抽象

type PackageWriter

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

type PackageWriterWrapper

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

func (PackageWriterWrapper) Write

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

type Platform

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
}

用于验证规范和编写的包的接口 给定平台

type Registry

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

func NewRegistry

func NewRegistry(platformTypes ...Platform) *Registry

func (*Registry) GenerateDockerBuild

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

func (*Registry) GenerateDockerfile

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

func (*Registry) GetDeploymentPayload

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

func (*Registry) GetMetadataProvider

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

func (*Registry) StreamDockerBuild

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

func (*Registry) ValidateDeploymentSpec

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

func (*Registry) ValidateSpec

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

Directories

Path Synopsis
伪造者生成的代码。
伪造者生成的代码。

Jump to

Keyboard shortcuts

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