golang

package
v0.0.0-...-a56bd7b Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeDescriptor

type CodeDescriptor struct {
	Source       string // absolute path of the source to package
	MetadataRoot string // absolute path META-INF
	Path         string // import path of the package
	Module       bool   // does this represent a go module
}

CodeDescriptor describes the code we're packaging.

func DescribeCode

func DescribeCode(path string) (*CodeDescriptor, error)

DescribeCode returns GOPATH and package information.

type ModuleInfo

type ModuleInfo struct {
	Dir        string `json:"dir,omitempty"`
	ImportPath string `json:"import_path,omitempty"`
	ModulePath string `json:"module_path,omitempty"`
	GoMod      string `json:"gomod,omitempty"`
}

type PackageInfo

type PackageInfo struct {
	ImportPath     string   `json:"import_path,omitempty"`
	Dir            string   `json:"dir,omitempty"`
	GoFiles        []string `json:"go_files,omitempty"`
	CFiles         []string `json:"c_files,omitempty"`
	CgoFiles       []string `json:"cgo_files,omitempty"`
	HFiles         []string `json:"h_files,omitempty"`
	SFiles         []string `json:"s_files,omitempty"`
	IgnoredGoFiles []string `json:"ignored_go_files,omitempty"`
	Incomplete     bool     `json:"incomplete,omitempty"`
}

func (PackageInfo) Files

func (p PackageInfo) Files() []string

type Platform

type Platform struct{}

Platform for chaincodes written in Go

func (*Platform) DockerBuildOptions

func (p *Platform) DockerBuildOptions(path string) (util.DockerBuildOptions, error)

func (*Platform) GenerateDockerfile

func (p *Platform) GenerateDockerfile() (string, error)

func (*Platform) GetDeploymentPayload

func (p *Platform) GetDeploymentPayload(codepath string) ([]byte, error)

GetDeploymentPayload creates a gzip compressed tape archive that contains the required assets to build and run go chaincode.

NOTE: this is only used at the _client_ side by the peer CLI.

func (*Platform) Name

func (p *Platform) Name() string

Name returns the name of this platform.

func (*Platform) NormalizePath

func (p *Platform) NormalizePath(rawPath string) (string, error)

NormalizePath is used to extract a relative module path from a module root. This should not impact legacy GOPATH chaincode.

NOTE: this is only used at the _client_ side by the peer CLI.

func (*Platform) ValidateCodePackage

func (p *Platform) ValidateCodePackage(code []byte) error

ValidateCodePackage examines the chaincode archive to ensure it is valid.

NOTE: this code is used in some transaction validation paths but can be changed post 2.0.

func (*Platform) ValidatePath

func (p *Platform) ValidatePath(rawPath string) error

ValidatePath is used to ensure that path provided points to something that looks like go chainccode.

NOTE: this is only used at the _client_ side by the peer CLI.

type SourceDescriptor

type SourceDescriptor struct {
	Name string
	Path string
}

type SourceMap

type SourceMap map[string]SourceDescriptor

func (SourceMap) Directories

func (s SourceMap) Directories() []string

func (SourceMap) Sources

func (s SourceMap) Sources() Sources

type Sources

type Sources []SourceDescriptor

func (Sources) Len

func (s Sources) Len() int

func (Sources) Less

func (s Sources) Less(i, j int) bool

func (Sources) Swap

func (s Sources) Swap(i, j int)

Jump to

Keyboard shortcuts

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