common

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: BSD-3-Clause Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFileContent

func ExtractFileContent(fileSelectorValue interface{}) ([]byte, error)

ExtractFileContent returns content of a fileselector field

func GetActivityInputSchema

func GetActivityInputSchema(ctx activity.Context, name string) (string, error)

GetActivityInputSchema returns schema of an activity input attribute

func GetSettings

func GetSettings(connector map[string]interface{}) (map[string]interface{}, error)

GetSettings returns map of parameter values of a connector

func ReadFile

func ReadFile(filePath string) ([]byte, error)

ReadFile returns content of a specified file

func Subst

func Subst(path string) string

Subst replaces instances of '${VARNAME}' (eg ${GOPATH}) with the variable. Variables names that are not set by the SDK are replaced with the environment variable.

Types

type ConnectorSpec

type ConnectorSpec struct {
	Name           string
	NetworkConfig  []byte
	EntityMatchers []byte
	OrgName        string
	UserName       string
	ChannelID      string
	TimeoutMillis  int
	Endpoints      []string
}

ConnectorSpec contains configuration parameters of a Fabric connector

type FabricClient

type FabricClient struct {
	// contains filtered or unexported fields
}

FabricClient holds fabric client pointers for chaincode invocations.

func NewFabricClient

func NewFabricClient(config ConnectorSpec) (*FabricClient, error)

NewFabricClient returns a new or cached fabric client

func (*FabricClient) Close

func (c *FabricClient) Close()

Close closes Fabric client connection

func (*FabricClient) ExecuteChaincode

func (c *FabricClient) ExecuteChaincode(ccID, fcn string, args [][]byte, transient map[string][]byte) ([]byte, int, error)

ExecuteChaincode sends invocation request to Fabric network

func (*FabricClient) QueryChaincode

func (c *FabricClient) QueryChaincode(ccID, fcn string, args [][]byte, transient map[string][]byte) ([]byte, int, error)

QueryChaincode sends query request to Fabric network

type ParameterIndex

type ParameterIndex struct {
	Name     string
	JSONType string
	// contains filtered or unexported fields
}

ParameterIndex stores transaction parameters and its location in raw JSON schema string start and end location is used to sort the parameter list to match the parameter order in schema

func OrderedParameters

func OrderedParameters(schemaData []byte) ([]ParameterIndex, error)

OrderedParameters returns parameters of a JSON schema object sorted by their position in schema definition This is necessary because Golang JSON parser does not maintain the sequence of object parameters.

Jump to

Keyboard shortcuts

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