common

package
v0.0.0-...-3928428 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: MIT Imports: 15 Imported by: 0

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 GetSettings

func GetSettings(connection 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 SetFlogoLogLevel

func SetFlogoLogLevel(log logger.Logger)

SetFlogoLogLevel sets log level of a Flogo app logger according to env 'FLOGO_LOG_LEVEL'

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
}

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, 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, error)

QueryChaincode sends query request to Fabric network

Jump to

Keyboard shortcuts

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