dockercontroller

package
v1.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ContainerType = "DOCKER"

ContainerType is the string which the docker container type is registered with the container.VMController

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerVM

type DockerVM struct {
	PeerID    string
	NetworkID string
	// contains filtered or unexported fields
}

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

func NewDockerVM

func NewDockerVM(peerID, networkID string) *DockerVM

NewDockerVM returns a new DockerVM instance

func (*DockerVM) GetVMName

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

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) GetVMNameForDocker

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

GetVMNameForDocker formats the docker image from peer information. This is needed to keep image (repository) names unique in a single host, multi-peer environment (such as a development environment). It computes the hash for the supplied image name and then appends it to the lowercase image name to ensure uniqueness.

func (*DockerVM) Start

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

Start starts a container using a previously created docker image

func (*DockerVM) Stop

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

Stop stops a running chaincode

type Provider

type Provider struct {
	PeerID    string
	NetworkID string
}

Controller implements container.VMProvider

func NewProvider

func NewProvider(peerID, networkID string) *Provider

NewProvider creates a new instance of Provider

func (*Provider) NewVM

func (p *Provider) NewVM() container.VM

NewVM creates a new DockerVM instance

Jump to

Keyboard shortcuts

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