fabric: github.com/hyperledger/fabric/core/container/dockercontroller Index | Files

package dockercontroller

import "github.com/hyperledger/fabric/core/container/dockercontroller"


Package Files

dockercontroller.go metrics.go


const ContainerType = "DOCKER"

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

type BuildMetrics Uses

type BuildMetrics struct {
    ChaincodeImageBuildDuration metrics.Histogram

func NewBuildMetrics Uses

func NewBuildMetrics(p metrics.Provider) *BuildMetrics

type DockerVM Uses

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

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

func NewDockerVM Uses

func NewDockerVM(peerID, networkID string, buildMetrics *BuildMetrics) *DockerVM

NewDockerVM returns a new DockerVM instance

func (*DockerVM) GetVMName Uses

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 Uses

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) HealthCheck Uses

func (vm *DockerVM) HealthCheck(ctx context.Context) error

HealthCheck checks if the DockerVM is able to communicate with the Docker daemon.

func (*DockerVM) Start Uses

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

Start starts a container using a previously created docker image

func (*DockerVM) Stop Uses

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

Stop stops a running chaincode

func (*DockerVM) Wait Uses

func (vm *DockerVM) Wait(ccid ccintf.CCID) (int, error)

Wait blocks until the container stops and returns the exit code of the container.

type Provider Uses

type Provider struct {
    PeerID       string
    NetworkID    string
    BuildMetrics *BuildMetrics

Provider implements container.VMProvider

func NewProvider Uses

func NewProvider(peerID, networkID string, metricsProvider metrics.Provider) *Provider

NewProvider creates a new instance of Provider

func (*Provider) NewVM Uses

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

NewVM creates a new DockerVM instance

Package dockercontroller imports 21 packages (graph) and is imported by 25 packages. Updated 2019-02-26. Refresh now. Tools for package owners.