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

package container

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

Index

Package Files

controller.go

func GetChaincodePackageBytes Uses

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

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

type Builder Uses

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

type ExitedFunc Uses

type ExitedFunc func(exitCode int, err error)

ExitedFunc is the prototype for the function called when a container exits.

type PlatformBuilder Uses

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

PlatformBuilder implements the Build interface using the platforms package GenerateDockerBuild function. XXX This is a pretty awkward spot for the builder, it should really probably be pushed into the dockercontroller, as it only builds docker images, but, doing so would require contaminating the dockercontroller package with the CDS, which is also undesirable.

func (*PlatformBuilder) Build Uses

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

Build a tar stream based on the CDS

type StartContainerReq Uses

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

StartContainerReq - properties for starting a container.

func (StartContainerReq) Do Uses

func (si StartContainerReq) Do(v VM) error

func (StartContainerReq) GetCCID Uses

func (si StartContainerReq) GetCCID() ccintf.CCID

type StopContainerReq Uses

type StopContainerReq struct {
    ccintf.CCID
    Timeout uint
    //by default we will kill the container after stopping
    Dontkill bool
    //by default we will remove the container after killing
    Dontremove bool
}

StopContainerReq - properties for stopping a container.

func (StopContainerReq) Do Uses

func (si StopContainerReq) Do(v VM) error

func (StopContainerReq) GetCCID Uses

func (si StopContainerReq) GetCCID() ccintf.CCID

type VM Uses

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
    Wait(ccid ccintf.CCID) (int, error)
    HealthCheck(context.Context) error
}

VM is an abstract virtual image for supporting arbitrary virual machines

type VMCReq Uses

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

VMCReq - all requests should implement this interface. The context should be passed and tested at each layer till we stop note that we'd stop on the first method on the stack that does not take context

type VMController Uses

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

VMController - manages VMs

. abstract construction of different types of VMs (we only care about Docker for now)
. manage lifecycle of VM (start with build, start, stop ...
  eventually probably need fine grained management)

func NewVMController Uses

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

NewVMController creates a new instance of VMController

func (*VMController) Process Uses

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

type VMProvider Uses

type VMProvider interface {
    NewVM() VM
}

type WaitContainerReq Uses

type WaitContainerReq struct {
    CCID   ccintf.CCID
    Exited ExitedFunc
}

WaitContainerReq provides the chaincode ID of the container to wait on and a callback to call upon chaincode termination.

func (WaitContainerReq) Do Uses

func (w WaitContainerReq) Do(v VM) error

func (WaitContainerReq) GetCCID Uses

func (w WaitContainerReq) GetCCID() ccintf.CCID

Directories

PathSynopsis
ccintf
dockercontroller
inproccontroller
mockCode generated by counterfeiter.
util

Package container imports 8 packages (graph) and is imported by 63 packages. Updated 2019-09-14. Refresh now. Tools for package owners.