Documentation ¶
Index ¶
- Constants
- Variables
- func NewCommand(name string, envWhiteList []string, args ...string) *exec.Cmd
- func RunCommand(logger *flogging.FabricLogger, cmd *exec.Cmd) error
- func SanitizeCCIDPath(ccid string) string
- func Untar(buffer io.Reader, dst string) error
- func ValidPath(uncleanPath string) bool
- type BuildContext
- type BuildInfo
- type Builder
- type Detector
- type Instance
- type MetadataProvider
- type RunConfig
- type RunStatus
Constants ¶
const MetadataFile = "metadata.json"
Variables ¶
var (
DefaultEnvWhitelist = []string{"LD_LIBRARY_PATH", "LIBPATH", "PATH", "TMPDIR"}
)
Functions ¶
func NewCommand ¶
NewCommand creates an exec.Cmd that is configured to prune the calling environment down to the environment variables specified in the external builder's EnvironmentWhitelist and the DefaultEnvWhitelist defined above.
func RunCommand ¶
func RunCommand(logger *flogging.FabricLogger, cmd *exec.Cmd) error
func SanitizeCCIDPath ¶
Types ¶
type BuildContext ¶
type BuildContext struct { CCID string Metadata *persistence.ChaincodePackageMetadata ScratchDir string SourceDir string ReleaseDir string MetadataDir string BldDir string }
func NewBuildContext ¶
func NewBuildContext(ccid string, md *persistence.ChaincodePackageMetadata, codePackage io.Reader) (bc *BuildContext, err error)
func (*BuildContext) Cleanup ¶
func (bc *BuildContext) Cleanup()
type Builder ¶
type Builder struct { EnvWhitelist []string Location string Logger *flogging.FabricLogger Name string }
func CreateBuilders ¶
func CreateBuilders(builderConfs []peer.ExternalBuilder) []*Builder
func (*Builder) Build ¶
func (b *Builder) Build(buildContext *BuildContext) error
func (*Builder) Detect ¶
func (b *Builder) Detect(buildContext *BuildContext) bool
func (*Builder) Release ¶
func (b *Builder) Release(buildContext *BuildContext) error
type Detector ¶
func (*Detector) Build ¶
func (d *Detector) Build(ccid string, md *persistence.ChaincodePackageMetadata, codeStream io.Reader) (*Instance, error)
func (*Detector) CachedBuild ¶
CachedBuild returns a build instance that was already built, or nil, or when an unexpected error is encountered, an error.
func (*Detector) Detect ¶
func (d *Detector) Detect(buildContext *BuildContext) *Builder
type MetadataProvider ¶
type MetadataProvider struct {
DurablePath string
}
func (*MetadataProvider) PackageMetadata ¶
func (mp *MetadataProvider) PackageMetadata(ccid string) ([]byte, error)
PackageMetadata returns a set of bytes encoded as a tar file, containing the release metadata as provided by the external builder. If no directory with build output from the external builder is found, the tar bytes will be nil. If the build output is found, but there is no metadata, the bytes will be an empty tar. An error is returned only if the build output is found but some other error occurs.
type RunConfig ¶
type RunConfig struct { CCID string `json:"chaincode_id"` PeerAddress string `json:"peer_address"` ClientCert []byte `json:"client_cert"` ClientKey []byte `json:"client_key"` RootCert []byte `json:"root_cert"` }
RunConfig is serialized to disk when launching
type RunStatus ¶
type RunStatus struct {
// contains filtered or unexported fields
}
func NewRunStatus ¶
func NewRunStatus() *RunStatus