sdk

package module
v0.0.0-...-c64b6c5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReadingsContractName = "readings"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainmentricSDK

type ChainmentricSDK struct {
	Readings *ReadingsContract
	// contains filtered or unexported fields
}

func (*ChainmentricSDK) AuthIdentity

func (sdk *ChainmentricSDK) AuthIdentity(orgID, key, cert string) error

func (*ChainmentricSDK) AuthRequired

func (sdk *ChainmentricSDK) AuthRequired() bool

func (*ChainmentricSDK) EvaluateTransaction

func (sdk *ChainmentricSDK) EvaluateTransaction(chaincode, transaction string, args string) (string, error)

func (*ChainmentricSDK) Init

func (sdk *ChainmentricSDK) Init()

func (*ChainmentricSDK) InitConnectionOn

func (sdk *ChainmentricSDK) InitConnectionOn(configRaw, channel string) error

func (*ChainmentricSDK) InitWallet

func (sdk *ChainmentricSDK) InitWallet(path string) error

func (*ChainmentricSDK) SubmitTransaction

func (sdk *ChainmentricSDK) SubmitTransaction(chaincode, transaction string, args string) (string, error)

type EventChannel

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

func NewEventsChannel

func NewEventsChannel() *EventChannel

func (*EventChannel) Cancel

func (ec *EventChannel) Cancel()

func (*EventChannel) SetCancel

func (ec *EventChannel) SetCancel(cancel context.CancelFunc)

func (*EventChannel) SetHandler

func (ec *EventChannel) SetHandler(handler EventHandler)

type EventHandler

type EventHandler interface {
	HandleEvent(string) error
}

type ReadingsContract

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

func NewReadingsContract

func NewReadingsContract(sdk *ChainmentricSDK) *ReadingsContract

func (*ReadingsContract) BindToEventSocket

func (rc *ReadingsContract) BindToEventSocket(assetID, metric string) (string, error)

func (*ReadingsContract) CloseEventSocket

func (rc *ReadingsContract) CloseEventSocket(eventToken string) error

func (*ReadingsContract) ForAsset

func (rc *ReadingsContract) ForAsset(assetID string) (string, error)

func (*ReadingsContract) ForMetric

func (rc *ReadingsContract) ForMetric(assetID, metric string) (string, error)

func (*ReadingsContract) SubscribeFor

func (rc *ReadingsContract) SubscribeFor(assetID, metric string) (*EventChannel, error)

Jump to

Keyboard shortcuts

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