container

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

func GetChaincodePackageBytes

func GetChaincodePackageBytes(pr *platforms.Registry, spec *pb.ChaincodeSpec) ([]byte, error)

GetChaincodePackageBytes creates bytes for docker container generation using the supplied chaincode specification

Types

type Builder

type Builder interface {
	Build() (io.Reader, error)
}

type PlatformBuilder

type PlatformBuilder struct {
	Type             string
	Path             string
	Name             string
	Version          string
	CodePackage      []byte
	PlatformRegistry *platforms.Registry
}

PlatformBuilder使用 平台包生成了ckerbuild函数。 这对建筑商来说是个相当尴尬的地方,应该是 很可能会被推到码头控制中心,因为它只是 创建Docker图像,但这样做需要污染 带CD的DockerController软件包,也就是 不受欢迎的

func (*PlatformBuilder) Build

func (b *PlatformBuilder) Build() (io.Reader, error)

基于CD构建tar流

type StartContainerReq

type StartContainerReq struct {
	ccintf.CCID
	Builder       Builder
	Args          []string
	Env           []string
	FilesToUpload map[string][]byte
}

StartContainerReq-用于启动容器的属性。

func (StartContainerReq) Do

func (si StartContainerReq) Do(v VM) error

func (StartContainerReq) GetCCID

func (si StartContainerReq) GetCCID() ccintf.CCID

type StopContainerReq

type StopContainerReq struct {
	ccintf.CCID
	Timeout uint
	//默认情况下,我们会在停止后杀死容器
	Dontkill bool
	//默认情况下,我们会在杀死后移除容器
	Dontremove bool
}

StopContainerReq - properties for stopping a container.

func (StopContainerReq) Do

func (si StopContainerReq) Do(v VM) error

func (StopContainerReq) GetCCID

func (si StopContainerReq) GetCCID() ccintf.CCID

type VM

type VM interface {
	Start(ccid ccintf.CCID, args []string, env []string, filesToUpload map[string][]byte, builder Builder) error
	Stop(ccid ccintf.CCID, timeout uint, dontkill bool, dontremove bool) error
	HealthCheck(context.Context) error
}

虚拟机是支持任意虚拟机的抽象虚拟映像

type VMCReq

type VMCReq interface {
	Do(v VM) error
	GetCCID() ccintf.CCID
}

vmcreq-所有请求都应该实现这个接口。 上下文应该在每一层通过并测试,直到我们停止 请注意,我们将在堆栈中第一个不 取上下文

type VMController

type VMController struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

vmcontroller-管理vms . abstract construction of different types of VMs (we only care about Docker for now) . 管理虚拟机的生命周期(从build开始,start,stop… 最终可能需要细粒度管理)

func NewVMController

func NewVMController(vmProviders map[string]VMProvider) *VMController

new vmcontroller创建vmcontroller的新实例

func (*VMController) Process

func (vmc *VMController) Process(vmtype string, req VMCReq) error

type VMProvider

type VMProvider interface {
	NewVM() VM
}

Directories

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

Jump to

Keyboard shortcuts

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