dockercontroller

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: GPL-3.0, GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerVM

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

DockerVM is a vm. It is identified by an image id

func NewDockerVM

func NewDockerVM() *DockerVM

NewDockerVM returns a new DockerVM instance

func (*DockerVM) Deploy

func (vm *DockerVM) Deploy(ctxt context.Context, ccid ccintf.CCID,
	args []string, env []string, reader io.Reader) error

Deploy use the reader containing targz to create a docker image for docker inputbuf is tar reader ready for use by docker.Client the stream from end client to peer could directly be this tar stream talk to docker daemon using docker Client and build the image

func (*DockerVM) Destroy

func (vm *DockerVM) Destroy(ctxt context.Context, ccid ccintf.CCID, force bool, noprune bool) error

Destroy destroys an image

func (*DockerVM) GetContainerId

func (vm *DockerVM) GetContainerId(ccid ccintf.CCID) (string, error)

func (*DockerVM) GetImageId

func (vm *DockerVM) GetImageId(ccid ccintf.CCID) (string, error)

func (*DockerVM) GetVMName

func (vm *DockerVM) GetVMName(ccid ccintf.CCID, format func(string) (string, error)) (string, error)

GetVMName generates the VM name from peer information. It accepts a format function parameter to allow different formatting based on the desired use of the name.

func (*DockerVM) Start

func (vm *DockerVM) Start(_ context.Context, ccid ccintf.CCID,
	args []string, env []string, filesToUpload map[string][]byte, builder container.BuildSpecFactory, prelaunchFunc container.PrelaunchFunc) error

Start starts a container using a previously created docker image 根据之前指定的镜像文件启动容器,如果镜像文件不存在则新创建,成功后启动容器 这里还可以指定对容器日志的输出

func (*DockerVM) Stop

func (vm *DockerVM) Stop(_ context.Context, ccid ccintf.CCID, timeout uint, dontkill bool, dontremove bool) error

Stop stops a running chaincode

Jump to

Keyboard shortcuts

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