transaction

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: BSD-3-Clause Imports: 15 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// STransaction is the name of the handler setting entry for transaction name
	STransaction = "name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
}

Factory for trigger

func (*Factory) Metadata

func (*Factory) Metadata() *trigger.Metadata

Metadata implements trigger.Factory.Metadata

func (*Factory) New

func (t *Factory) New(config *trigger.Config) (trigger.Trigger, error)

New implements trigger.Factory.New

type HandlerSettings

type HandlerSettings struct {
	Name       string `md:"name,required"`
	Validation bool   `md:"validation"`
}

HandlerSettings for the trigger

type Output

type Output struct {
	Parameters    map[string]interface{} `md:"parameters"`
	Transient     map[string]interface{} `md:"transient"`
	TxID          string                 `md:"txID"`
	TxTime        string                 `md:"txTime"`
	ChaincodeStub interface{}            `md:"_chaincode_stub"`
}

Output of the trigger

func (*Output) FromMap

func (o *Output) FromMap(values map[string]interface{}) error

FromMap sets trigger output values from a map

func (*Output) ToMap

func (o *Output) ToMap() map[string]interface{}

ToMap converts trigger output to a map

type Reply

type Reply struct {
	Status  int         `md:"status"`
	Message string      `md:"message"`
	Returns interface{} `md:"returns"`
}

Reply from the trigger

func (*Reply) FromMap

func (r *Reply) FromMap(values map[string]interface{}) error

FromMap sets trigger reply values from a map

func (*Reply) ToMap

func (r *Reply) ToMap() map[string]interface{}

ToMap converts trigger reply to a map

type Settings

type Settings struct {
}

Settings for the trigger

type Trigger

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

Trigger is a stub for the Trigger implementation

func GetTrigger

func GetTrigger(name string) (*Trigger, bool)

GetTrigger returns the cached trigger for a specified transaction name; return false in the second value if no trigger is cached for the specified name

func (*Trigger) Initialize

func (t *Trigger) Initialize(ctx trigger.InitContext) error

Initialize implements trigger.Init.Initialize

func (*Trigger) Invoke

func (t *Trigger) Invoke(stub shim.ChaincodeStubInterface, fn string, args []string) (int, string, error)

Invoke starts the trigger and invokes the action registered in the handler, and returns status code and result as JSON string

func (*Trigger) Start

func (t *Trigger) Start() error

Start implements trigger.Trigger.Start

func (*Trigger) Stop

func (t *Trigger) Stop() error

Stop implements trigger.Trigger.Start

Jump to

Keyboard shortcuts

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