gateway

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: MIT Imports: 12 Imported by: 13

Documentation

Index

Constants

View Source
const CtxTransientKey = `TransientMap`

Variables

View Source
var (
	ErrEventChannelClosed = errors.New(`event channel is closed`)
)

Functions

func ContextWithTransientMap

func ContextWithTransientMap(ctx context.Context, transient map[string][]byte) context.Context

func ContextWithTransientValue

func ContextWithTransientValue(ctx context.Context, key string, value []byte) context.Context

func NewChaincode

func NewChaincode(service service.Chaincode, channelName, chaincodeName string, opts ...Opt) *chaincode

func TransientFromContext

func TransientFromContext(ctx context.Context) (map[string][]byte, error)

Types

type Action

type Action string
const (
	Query  Action = `query`
	Invoke Action = `invoke`
)

type Chaincode

type Chaincode interface {
	Query(ctx context.Context, fn string, args []interface{}, target interface{}) (interface{}, error)
	Invoke(ctx context.Context, fn string, args []interface{}, target interface{}) (interface{}, error)
	Events(ctx context.Context) (ChaincodeEventSub, error)
}

type ChaincodeEventServerStream

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

func NewChaincodeEventServerStream

func NewChaincodeEventServerStream(ctx context.Context, opts ...EventOpt) (stream *ChaincodeEventServerStream)

func (*ChaincodeEventServerStream) Close

func (s *ChaincodeEventServerStream) Close()

func (*ChaincodeEventServerStream) Context

func (*ChaincodeEventServerStream) Events

func (s *ChaincodeEventServerStream) Events() <-chan *peer.ChaincodeEvent

func (*ChaincodeEventServerStream) Recv

func (*ChaincodeEventServerStream) RecvMsg

func (s *ChaincodeEventServerStream) RecvMsg(m interface{}) error

func (*ChaincodeEventServerStream) SendHeader

func (*ChaincodeEventServerStream) SendMsg

func (s *ChaincodeEventServerStream) SendMsg(m interface{}) (err error)

func (*ChaincodeEventServerStream) SetHeader

func (*ChaincodeEventServerStream) SetTrailer

func (*ChaincodeEventServerStream) SetTrailer(metadata.MD)

type ChaincodeEventSub

type ChaincodeEventSub interface {
	Context() context.Context
	Events() <-chan *peer.ChaincodeEvent
	Recv(*peer.ChaincodeEvent) error
	Close()
}

type ContextOpt

type ContextOpt func(ctx context.Context) context.Context

type EventOpt

type EventOpt func(event *peer.ChaincodeEvent) error

type InputOpt

type InputOpt func(action Action, input *service.ChaincodeInput) error

type Opt

type Opt func(*chaincode)

func WithArgsEncryption

func WithArgsEncryption(encKey []byte) Opt

func WithDefaultSigner

func WithDefaultSigner(defaultSigner msp.SigningIdentity) Opt

func WithEncryption

func WithEncryption(encKey []byte) Opt

func WithEventDecryption

func WithEventDecryption(encKey []byte) Opt

func WithInvokePayloadDecryption

func WithInvokePayloadDecryption(encKey []byte) Opt

func WithTransientValue

func WithTransientValue(key string, value []byte) Opt

type OutputOpt

type OutputOpt func(action Action, response *peer.Response) error

type RegisterHandlerFromEndpoint

type RegisterHandlerFromEndpoint func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

type ServiceDef

type ServiceDef struct {
	Desc                        *grpc.ServiceDesc
	Service                     interface{}
	HandlerFromEndpointRegister RegisterHandlerFromEndpoint
}

Directories

Path Synopsis
Package service is a generated protocol buffer package.
Package service is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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