gateway

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 34 Imported by: ? modules, 0 packages

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.

README

CCKit gateway

Documentation

Overview

Package gateway is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	CtxTransientKey = contextKey(`TransientMap`)
	CtxSignerKey    = contextKey(`SigningIdentity`)
	CtxTxWaiterKey  = contextKey(`TxWaiter`)
)
View Source
const EventListStreamTimeout = 500 * time.Millisecond

Variables

View Source
var (
	InvocationType_name = map[int32]string{
		0: "INVOCATION_TYPE_QUERY",
		1: "INVOCATION_TYPE_INVOKE",
	}
	InvocationType_value = map[string]int32{
		"INVOCATION_TYPE_QUERY":  0,
		"INVOCATION_TYPE_INVOKE": 1,
	}
)

Enum value maps for InvocationType.

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

	// ErrChaincodeNotExists occurs when attempting to invoke a nonexostent external chaincode
	ErrChaincodeNotExists = errors.New(`chaincode not exists`)

	// ErrSignerNotDefinedInContext msp.SigningIdentity is not defined in context
	ErrSignerNotDefinedInContext = errors.New(`signer is not defined in context`)

	// ErrUnknownInvocationType query or invoke
	ErrUnknownInvocationType = errors.New(`unknown invocation type`)

	// ErrNewInvokerNotDefinedInContext is not defined in context
	ErrNewInvokerNotDefinedInContext = errors.New(`new invoker is not defined in context`)
)
View Source
var ErrInvokeMethodNotAllowed = errors.New(`invoke method not allowed`)
View Source
var File_chaincode_proto protoreflect.FileDescriptor

Functions

func BlockRange

func BlockRange(from, to *BlockLimit) []int64

func ContextWithDefaultSigner

func ContextWithDefaultSigner(ctx context.Context, defaultSigner msp.SigningIdentity) context.Context

func ContextWithSigner

func ContextWithSigner(ctx context.Context, signer msp.SigningIdentity) context.Context

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 ContextWithTxWaiter

func ContextWithTxWaiter(ctx context.Context, txWaiterType string) context.Context

func MatchEventName

func MatchEventName(eventName string, expectedNames []string) bool

func RegisterChaincodeEventsServiceHandler

func RegisterChaincodeEventsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterChaincodeEventsServiceHandler registers the http handlers for service ChaincodeEventsService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterChaincodeEventsServiceHandlerClient

func RegisterChaincodeEventsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodeEventsServiceClient) error

RegisterChaincodeEventsServiceHandlerClient registers the http handlers for service ChaincodeEventsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChaincodeEventsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChaincodeEventsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChaincodeEventsServiceClient" to call the correct interceptors.

func RegisterChaincodeEventsServiceHandlerFromEndpoint

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

RegisterChaincodeEventsServiceHandlerFromEndpoint is same as RegisterChaincodeEventsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterChaincodeEventsServiceHandlerServer

func RegisterChaincodeEventsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodeEventsServiceServer) error

RegisterChaincodeEventsServiceHandlerServer registers the http handlers for service ChaincodeEventsService to "mux". UnaryRPC :call ChaincodeEventsServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChaincodeEventsServiceHandlerFromEndpoint instead.

func RegisterChaincodeEventsServiceServer

func RegisterChaincodeEventsServiceServer(s *grpc.Server, srv ChaincodeEventsServiceServer)

func RegisterChaincodeInstanceEventsServiceHandler

func RegisterChaincodeInstanceEventsServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterChaincodeInstanceEventsServiceHandler registers the http handlers for service ChaincodeInstanceEventsService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterChaincodeInstanceEventsServiceHandlerClient

func RegisterChaincodeInstanceEventsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodeInstanceEventsServiceClient) error

RegisterChaincodeInstanceEventsServiceHandlerClient registers the http handlers for service ChaincodeInstanceEventsService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChaincodeInstanceEventsServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChaincodeInstanceEventsServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChaincodeInstanceEventsServiceClient" to call the correct interceptors.

func RegisterChaincodeInstanceEventsServiceHandlerFromEndpoint

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

RegisterChaincodeInstanceEventsServiceHandlerFromEndpoint is same as RegisterChaincodeInstanceEventsServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterChaincodeInstanceEventsServiceHandlerServer

func RegisterChaincodeInstanceEventsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodeInstanceEventsServiceServer) error

RegisterChaincodeInstanceEventsServiceHandlerServer registers the http handlers for service ChaincodeInstanceEventsService to "mux". UnaryRPC :call ChaincodeInstanceEventsServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChaincodeInstanceEventsServiceHandlerFromEndpoint instead.

func RegisterChaincodeInstanceEventsServiceServer

func RegisterChaincodeInstanceEventsServiceServer(s *grpc.Server, srv ChaincodeInstanceEventsServiceServer)

func RegisterChaincodeInstanceServiceHandler

func RegisterChaincodeInstanceServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterChaincodeInstanceServiceHandler registers the http handlers for service ChaincodeInstanceService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterChaincodeInstanceServiceHandlerClient

func RegisterChaincodeInstanceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodeInstanceServiceClient) error

RegisterChaincodeInstanceServiceHandlerClient registers the http handlers for service ChaincodeInstanceService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChaincodeInstanceServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChaincodeInstanceServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChaincodeInstanceServiceClient" to call the correct interceptors.

func RegisterChaincodeInstanceServiceHandlerFromEndpoint

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

RegisterChaincodeInstanceServiceHandlerFromEndpoint is same as RegisterChaincodeInstanceServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterChaincodeInstanceServiceHandlerServer

func RegisterChaincodeInstanceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodeInstanceServiceServer) error

RegisterChaincodeInstanceServiceHandlerServer registers the http handlers for service ChaincodeInstanceService to "mux". UnaryRPC :call ChaincodeInstanceServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChaincodeInstanceServiceHandlerFromEndpoint instead.

func RegisterChaincodeInstanceServiceServer

func RegisterChaincodeInstanceServiceServer(s *grpc.Server, srv ChaincodeInstanceServiceServer)

func RegisterChaincodeServiceHandler

func RegisterChaincodeServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterChaincodeServiceHandler registers the http handlers for service ChaincodeService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterChaincodeServiceHandlerClient

func RegisterChaincodeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodeServiceClient) error

RegisterChaincodeServiceHandlerClient registers the http handlers for service ChaincodeService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChaincodeServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChaincodeServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChaincodeServiceClient" to call the correct interceptors.

func RegisterChaincodeServiceHandlerFromEndpoint

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

RegisterChaincodeServiceHandlerFromEndpoint is same as RegisterChaincodeServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterChaincodeServiceHandlerServer

func RegisterChaincodeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodeServiceServer) error

RegisterChaincodeServiceHandlerServer registers the http handlers for service ChaincodeService to "mux". UnaryRPC :call ChaincodeServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterChaincodeServiceHandlerFromEndpoint instead.

func RegisterChaincodeServiceServer

func RegisterChaincodeServiceServer(s *grpc.Server, srv ChaincodeServiceServer)

func SignerFromContext

func SignerFromContext(ctx context.Context) (msp.SigningIdentity, error)

func TransientFromContext

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

func TxWaiterFromContext

func TxWaiterFromContext(ctx context.Context) string

TxWaiterFromContext - fetch 'txWaiterType' param which identify transaction waiting policy what params you'll have depends on your implementation for example, in hlf-sdk: available: 'self'(wait for one peer of endorser org), 'all'(wait for each organizations from endorsement policy) default is 'self'(even if you pass empty string)

Types

type BlockLimit

type BlockLimit struct {

	// Block number
	Num int64 `protobuf:"varint,1,opt,name=num,proto3" json:"num,omitempty"`
	// contains filtered or unexported fields
}

Block limit number for event stream subscription or event list Values can be negative

func (*BlockLimit) Descriptor deprecated

func (*BlockLimit) Descriptor() ([]byte, []int)

Deprecated: Use BlockLimit.ProtoReflect.Descriptor instead.

func (*BlockLimit) GetNum

func (x *BlockLimit) GetNum() int64

func (*BlockLimit) ProtoMessage

func (*BlockLimit) ProtoMessage()

func (*BlockLimit) ProtoReflect

func (x *BlockLimit) ProtoReflect() protoreflect.Message

func (*BlockLimit) Reset

func (x *BlockLimit) Reset()

func (*BlockLimit) String

func (x *BlockLimit) String() string

func (*BlockLimit) Validate

func (this *BlockLimit) Validate() error

type ChaincodeEvent

type ChaincodeEvent struct {
	Event       *peer.ChaincodeEvent   `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
	Block       uint64                 `protobuf:"varint,2,opt,name=block,proto3" json:"block,omitempty"`
	TxTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=tx_timestamp,json=txTimestamp,proto3" json:"tx_timestamp,omitempty"`
	Payload     *RawJson               `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func ProcessEvent

func ProcessEvent(event interface {
	Event() *peer.ChaincodeEvent
	Block() uint64
	TxTimestamp() *timestamp.Timestamp
}, opts []EventOpt, matchName []string) (*ChaincodeEvent, error)

func (*ChaincodeEvent) Descriptor deprecated

func (*ChaincodeEvent) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeEvent.ProtoReflect.Descriptor instead.

func (*ChaincodeEvent) GetBlock

func (x *ChaincodeEvent) GetBlock() uint64

func (*ChaincodeEvent) GetEvent

func (x *ChaincodeEvent) GetEvent() *peer.ChaincodeEvent

func (*ChaincodeEvent) GetPayload

func (x *ChaincodeEvent) GetPayload() *RawJson

func (*ChaincodeEvent) GetTxTimestamp

func (x *ChaincodeEvent) GetTxTimestamp() *timestamppb.Timestamp

func (*ChaincodeEvent) ProtoMessage

func (*ChaincodeEvent) ProtoMessage()

func (*ChaincodeEvent) ProtoReflect

func (x *ChaincodeEvent) ProtoReflect() protoreflect.Message

func (*ChaincodeEvent) Reset

func (x *ChaincodeEvent) Reset()

func (*ChaincodeEvent) String

func (x *ChaincodeEvent) String() string

func (*ChaincodeEvent) Validate

func (this *ChaincodeEvent) Validate() error

type ChaincodeEventServerStream

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

ChaincodeEventServerStream implements gRPC server stream interfaces

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 *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{}) error

func (*ChaincodeEventServerStream) SetHeader

func (*ChaincodeEventServerStream) SetTrailer

func (*ChaincodeEventServerStream) SetTrailer(metadata.MD)

type ChaincodeEventService

type ChaincodeEventService struct {
	EventDelivery sdk.EventDelivery
}

func NewChaincodeEventService

func NewChaincodeEventService(eventDelivery sdk.EventDelivery) *ChaincodeEventService

func (*ChaincodeEventService) Events

func (*ChaincodeEventService) EventsChan

func (ce *ChaincodeEventService) EventsChan(
	ctx context.Context, req *ChaincodeEventsStreamRequest) (_ chan *ChaincodeEvent, closer func() error, _ error)

func (*ChaincodeEventService) EventsStream

func (*ChaincodeEventService) ServiceDef

func (ce *ChaincodeEventService) ServiceDef() ServiceDef

ServiceDef returns service definition

type ChaincodeEvents

type ChaincodeEvents struct {
	Locator   *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	FromBlock *BlockLimit       `protobuf:"bytes,2,opt,name=from_block,json=fromBlock,proto3" json:"from_block,omitempty"`
	ToBlock   *BlockLimit       `protobuf:"bytes,3,opt,name=to_block,json=toBlock,proto3" json:"to_block,omitempty"`
	Items     []*ChaincodeEvent `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeEvents) Descriptor deprecated

func (*ChaincodeEvents) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeEvents.ProtoReflect.Descriptor instead.

func (*ChaincodeEvents) GetFromBlock

func (x *ChaincodeEvents) GetFromBlock() *BlockLimit

func (*ChaincodeEvents) GetItems

func (x *ChaincodeEvents) GetItems() []*ChaincodeEvent

func (*ChaincodeEvents) GetLocator

func (x *ChaincodeEvents) GetLocator() *ChaincodeLocator

func (*ChaincodeEvents) GetToBlock

func (x *ChaincodeEvents) GetToBlock() *BlockLimit

func (*ChaincodeEvents) ProtoMessage

func (*ChaincodeEvents) ProtoMessage()

func (*ChaincodeEvents) ProtoReflect

func (x *ChaincodeEvents) ProtoReflect() protoreflect.Message

func (*ChaincodeEvents) Reset

func (x *ChaincodeEvents) Reset()

func (*ChaincodeEvents) String

func (x *ChaincodeEvents) String() string

func (*ChaincodeEvents) Validate

func (this *ChaincodeEvents) Validate() error

type ChaincodeEventsRequest

type ChaincodeEventsRequest struct {
	Locator   *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	FromBlock *BlockLimit       `protobuf:"bytes,2,opt,name=from_block,json=fromBlock,proto3" json:"from_block,omitempty"`
	ToBlock   *BlockLimit       `protobuf:"bytes,3,opt,name=to_block,json=toBlock,proto3" json:"to_block,omitempty"`
	EventName []string          `protobuf:"bytes,4,rep,name=event_name,json=eventName,proto3" json:"event_name,omitempty"`
	Limit     uint32            `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

Chaincode events list request

func (*ChaincodeEventsRequest) Descriptor deprecated

func (*ChaincodeEventsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeEventsRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeEventsRequest) GetEventName

func (x *ChaincodeEventsRequest) GetEventName() []string

func (*ChaincodeEventsRequest) GetFromBlock

func (x *ChaincodeEventsRequest) GetFromBlock() *BlockLimit

func (*ChaincodeEventsRequest) GetLimit

func (x *ChaincodeEventsRequest) GetLimit() uint32

func (*ChaincodeEventsRequest) GetLocator

func (x *ChaincodeEventsRequest) GetLocator() *ChaincodeLocator

func (*ChaincodeEventsRequest) GetToBlock

func (x *ChaincodeEventsRequest) GetToBlock() *BlockLimit

func (*ChaincodeEventsRequest) ProtoMessage

func (*ChaincodeEventsRequest) ProtoMessage()

func (*ChaincodeEventsRequest) ProtoReflect

func (x *ChaincodeEventsRequest) ProtoReflect() protoreflect.Message

func (*ChaincodeEventsRequest) Reset

func (x *ChaincodeEventsRequest) Reset()

func (*ChaincodeEventsRequest) String

func (x *ChaincodeEventsRequest) String() string

func (*ChaincodeEventsRequest) Validate

func (this *ChaincodeEventsRequest) Validate() error

type ChaincodeEventsServer

type ChaincodeEventsServer = chaincodeServiceEventsStreamServer

ChaincodeEventsServer gateway/chaincode.go needs access to grpc stream

type ChaincodeEventsServiceClient

type ChaincodeEventsServiceClient interface {
	// Chaincode events stream
	EventsStream(ctx context.Context, in *ChaincodeEventsStreamRequest, opts ...grpc.CallOption) (ChaincodeEventsService_EventsStreamClient, error)
	// Chaincode events
	Events(ctx context.Context, in *ChaincodeEventsRequest, opts ...grpc.CallOption) (*ChaincodeEvents, error)
}

ChaincodeEventsServiceClient is the client API for ChaincodeEventsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ChaincodeEventsServiceServer

type ChaincodeEventsServiceServer interface {
	// Chaincode events stream
	EventsStream(*ChaincodeEventsStreamRequest, ChaincodeEventsService_EventsStreamServer) error
	// Chaincode events
	Events(context.Context, *ChaincodeEventsRequest) (*ChaincodeEvents, error)
}

ChaincodeEventsServiceServer is the server API for ChaincodeEventsService service.

type ChaincodeEventsService_EventsStreamClient

type ChaincodeEventsService_EventsStreamClient interface {
	Recv() (*ChaincodeEvent, error)
	grpc.ClientStream
}

type ChaincodeEventsService_EventsStreamServer

type ChaincodeEventsService_EventsStreamServer interface {
	Send(*ChaincodeEvent) error
	grpc.ServerStream
}

type ChaincodeEventsStreamRequest

type ChaincodeEventsStreamRequest struct {
	Locator   *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	FromBlock *BlockLimit       `protobuf:"bytes,2,opt,name=from_block,json=fromBlock,proto3" json:"from_block,omitempty"`
	ToBlock   *BlockLimit       `protobuf:"bytes,3,opt,name=to_block,json=toBlock,proto3" json:"to_block,omitempty"`
	EventName []string          `protobuf:"bytes,4,rep,name=event_name,json=eventName,proto3" json:"event_name,omitempty"`
	// contains filtered or unexported fields
}

Chaincode events stream request

func (*ChaincodeEventsStreamRequest) Descriptor deprecated

func (*ChaincodeEventsStreamRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeEventsStreamRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeEventsStreamRequest) GetEventName

func (x *ChaincodeEventsStreamRequest) GetEventName() []string

func (*ChaincodeEventsStreamRequest) GetFromBlock

func (x *ChaincodeEventsStreamRequest) GetFromBlock() *BlockLimit

func (*ChaincodeEventsStreamRequest) GetLocator

func (*ChaincodeEventsStreamRequest) GetToBlock

func (x *ChaincodeEventsStreamRequest) GetToBlock() *BlockLimit

func (*ChaincodeEventsStreamRequest) ProtoMessage

func (*ChaincodeEventsStreamRequest) ProtoMessage()

func (*ChaincodeEventsStreamRequest) ProtoReflect

func (*ChaincodeEventsStreamRequest) Reset

func (x *ChaincodeEventsStreamRequest) Reset()

func (*ChaincodeEventsStreamRequest) String

func (*ChaincodeEventsStreamRequest) Validate

func (this *ChaincodeEventsStreamRequest) Validate() error

type ChaincodeExecRequest

type ChaincodeExecRequest struct {
	Locator *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	Type    InvocationType    `protobuf:"varint,2,opt,name=type,proto3,enum=cckit.gateway.InvocationType" json:"type,omitempty"`
	Input   *ChaincodeInput   `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

Chaincode execution specification

func (*ChaincodeExecRequest) Descriptor deprecated

func (*ChaincodeExecRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeExecRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeExecRequest) GetInput

func (x *ChaincodeExecRequest) GetInput() *ChaincodeInput

func (*ChaincodeExecRequest) GetLocator

func (x *ChaincodeExecRequest) GetLocator() *ChaincodeLocator

func (*ChaincodeExecRequest) GetType

func (x *ChaincodeExecRequest) GetType() InvocationType

func (*ChaincodeExecRequest) ProtoMessage

func (*ChaincodeExecRequest) ProtoMessage()

func (*ChaincodeExecRequest) ProtoReflect

func (x *ChaincodeExecRequest) ProtoReflect() protoreflect.Message

func (*ChaincodeExecRequest) Reset

func (x *ChaincodeExecRequest) Reset()

func (*ChaincodeExecRequest) String

func (x *ChaincodeExecRequest) String() string

func (*ChaincodeExecRequest) Validate

func (this *ChaincodeExecRequest) Validate() error

type ChaincodeInput

type ChaincodeInput struct {

	// Input contains the arguments for invocation.
	Args [][]byte `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"`
	// TransientMap contains data (e.g. cryptographic material) that might be used
	// to implement some form of application-level confidentiality. The contents
	// of this field are supposed to always be omitted from the transaction and
	// excluded from the ledger.
	Transient map[string][]byte `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

Chaincode invocation input

func (*ChaincodeInput) Descriptor deprecated

func (*ChaincodeInput) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInput.ProtoReflect.Descriptor instead.

func (*ChaincodeInput) GetArgs

func (x *ChaincodeInput) GetArgs() [][]byte

func (*ChaincodeInput) GetTransient

func (x *ChaincodeInput) GetTransient() map[string][]byte

func (*ChaincodeInput) ProtoMessage

func (*ChaincodeInput) ProtoMessage()

func (*ChaincodeInput) ProtoReflect

func (x *ChaincodeInput) ProtoReflect() protoreflect.Message

func (*ChaincodeInput) Reset

func (x *ChaincodeInput) Reset()

func (*ChaincodeInput) String

func (x *ChaincodeInput) String() string

func (*ChaincodeInput) Validate

func (this *ChaincodeInput) Validate() error

type ChaincodeInstance

type ChaincodeInstance interface {
	ChaincodeInstanceServiceServer

	EventsChan(ctx context.Context, rr ...*ChaincodeInstanceEventsStreamRequest) (
		_ chan *ChaincodeEvent, closer func() error, _ error)
}

ChaincodeInstance base implementation ChaincodeInstanceService - via SDK but also possible another implementation (via REST, another SDK etc)

type ChaincodeInstanceEventService

type ChaincodeInstanceEventService struct {
	EventDelivery sdk.EventDelivery
	Locator       *ChaincodeLocator
	Opts          *Opts
	Logger        *zap.Logger
}

func NewChaincodeInstanceEventService

func NewChaincodeInstanceEventService(delivery sdk.EventDelivery, channel, chaincode string, opts ...Opt) *ChaincodeInstanceEventService

func (*ChaincodeInstanceEventService) Events

func (*ChaincodeInstanceEventService) EventsChan

func (ces *ChaincodeInstanceEventService) EventsChan(ctx context.Context, rr ...*ChaincodeInstanceEventsStreamRequest) (_ chan *ChaincodeEvent, closer func() error, _ error)

EventsChan is not part of ChaincodeInstanceEventService interface, for calls as component

func (*ChaincodeInstanceEventService) ServiceDef

func (ces *ChaincodeInstanceEventService) ServiceDef() ServiceDef

type ChaincodeInstanceEvents

type ChaincodeInstanceEvents interface {
	ChaincodeInstanceEventsServiceServer

	EventsChan(ctx context.Context, rr ...*ChaincodeInstanceEventsStreamRequest) (
		_ chan *ChaincodeEvent, closer func() error, _ error)
}

type ChaincodeInstanceEventsRequest

type ChaincodeInstanceEventsRequest struct {
	FromBlock *BlockLimit `protobuf:"bytes,1,opt,name=from_block,json=fromBlock,proto3" json:"from_block,omitempty"`
	ToBlock   *BlockLimit `protobuf:"bytes,2,opt,name=to_block,json=toBlock,proto3" json:"to_block,omitempty"`
	EventName []string    `protobuf:"bytes,3,rep,name=event_name,json=eventName,proto3" json:"event_name,omitempty"`
	Limit     uint32      `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInstanceEventsRequest) Descriptor deprecated

func (*ChaincodeInstanceEventsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInstanceEventsRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInstanceEventsRequest) GetEventName

func (x *ChaincodeInstanceEventsRequest) GetEventName() []string

func (*ChaincodeInstanceEventsRequest) GetFromBlock

func (x *ChaincodeInstanceEventsRequest) GetFromBlock() *BlockLimit

func (*ChaincodeInstanceEventsRequest) GetLimit

func (x *ChaincodeInstanceEventsRequest) GetLimit() uint32

func (*ChaincodeInstanceEventsRequest) GetToBlock

func (x *ChaincodeInstanceEventsRequest) GetToBlock() *BlockLimit

func (*ChaincodeInstanceEventsRequest) ProtoMessage

func (*ChaincodeInstanceEventsRequest) ProtoMessage()

func (*ChaincodeInstanceEventsRequest) ProtoReflect

func (*ChaincodeInstanceEventsRequest) Reset

func (x *ChaincodeInstanceEventsRequest) Reset()

func (*ChaincodeInstanceEventsRequest) String

func (*ChaincodeInstanceEventsRequest) Validate

func (this *ChaincodeInstanceEventsRequest) Validate() error

type ChaincodeInstanceEventsServiceClient

type ChaincodeInstanceEventsServiceClient interface {
	// Chaincode events stream
	EventsStream(ctx context.Context, in *ChaincodeInstanceEventsStreamRequest, opts ...grpc.CallOption) (ChaincodeInstanceEventsService_EventsStreamClient, error)
	// Chaincode events s
	Events(ctx context.Context, in *ChaincodeInstanceEventsRequest, opts ...grpc.CallOption) (*ChaincodeEvents, error)
}

ChaincodeInstanceEventsServiceClient is the client API for ChaincodeInstanceEventsService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ChaincodeInstanceEventsServiceServer

type ChaincodeInstanceEventsServiceServer interface {
	// Chaincode events stream
	EventsStream(*ChaincodeInstanceEventsStreamRequest, ChaincodeInstanceEventsService_EventsStreamServer) error
	// Chaincode events s
	Events(context.Context, *ChaincodeInstanceEventsRequest) (*ChaincodeEvents, error)
}

ChaincodeInstanceEventsServiceServer is the server API for ChaincodeInstanceEventsService service.

type ChaincodeInstanceEventsService_EventsStreamClient

type ChaincodeInstanceEventsService_EventsStreamClient interface {
	Recv() (*ChaincodeEvent, error)
	grpc.ClientStream
}

type ChaincodeInstanceEventsService_EventsStreamServer

type ChaincodeInstanceEventsService_EventsStreamServer interface {
	Send(*ChaincodeEvent) error
	grpc.ServerStream
}

type ChaincodeInstanceEventsStreamRequest

type ChaincodeInstanceEventsStreamRequest struct {
	FromBlock *BlockLimit `protobuf:"bytes,1,opt,name=from_block,json=fromBlock,proto3" json:"from_block,omitempty"`
	ToBlock   *BlockLimit `protobuf:"bytes,2,opt,name=to_block,json=toBlock,proto3" json:"to_block,omitempty"`
	EventName []string    `protobuf:"bytes,3,rep,name=event_name,json=eventName,proto3" json:"event_name,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInstanceEventsStreamRequest) Descriptor deprecated

func (*ChaincodeInstanceEventsStreamRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInstanceEventsStreamRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInstanceEventsStreamRequest) GetEventName

func (x *ChaincodeInstanceEventsStreamRequest) GetEventName() []string

func (*ChaincodeInstanceEventsStreamRequest) GetFromBlock

func (*ChaincodeInstanceEventsStreamRequest) GetToBlock

func (*ChaincodeInstanceEventsStreamRequest) ProtoMessage

func (*ChaincodeInstanceEventsStreamRequest) ProtoMessage()

func (*ChaincodeInstanceEventsStreamRequest) ProtoReflect

func (*ChaincodeInstanceEventsStreamRequest) Reset

func (*ChaincodeInstanceEventsStreamRequest) String

func (*ChaincodeInstanceEventsStreamRequest) Validate

type ChaincodeInstanceExecRequest

type ChaincodeInstanceExecRequest struct {
	Type  InvocationType  `protobuf:"varint,1,opt,name=type,proto3,enum=cckit.gateway.InvocationType" json:"type,omitempty"`
	Input *ChaincodeInput `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInstanceExecRequest) Descriptor deprecated

func (*ChaincodeInstanceExecRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInstanceExecRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInstanceExecRequest) GetInput

func (*ChaincodeInstanceExecRequest) GetType

func (*ChaincodeInstanceExecRequest) ProtoMessage

func (*ChaincodeInstanceExecRequest) ProtoMessage()

func (*ChaincodeInstanceExecRequest) ProtoReflect

func (*ChaincodeInstanceExecRequest) Reset

func (x *ChaincodeInstanceExecRequest) Reset()

func (*ChaincodeInstanceExecRequest) String

func (*ChaincodeInstanceExecRequest) Validate

func (this *ChaincodeInstanceExecRequest) Validate() error

type ChaincodeInstanceInvokeRequest

type ChaincodeInstanceInvokeRequest struct {
	Input *ChaincodeInput `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInstanceInvokeRequest) Descriptor deprecated

func (*ChaincodeInstanceInvokeRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInstanceInvokeRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInstanceInvokeRequest) GetInput

func (*ChaincodeInstanceInvokeRequest) ProtoMessage

func (*ChaincodeInstanceInvokeRequest) ProtoMessage()

func (*ChaincodeInstanceInvokeRequest) ProtoReflect

func (*ChaincodeInstanceInvokeRequest) Reset

func (x *ChaincodeInstanceInvokeRequest) Reset()

func (*ChaincodeInstanceInvokeRequest) String

func (*ChaincodeInstanceInvokeRequest) Validate

func (this *ChaincodeInstanceInvokeRequest) Validate() error

type ChaincodeInstanceInvoker

type ChaincodeInstanceInvoker 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)
}

ChaincodeInvoker used in generated service gateway code

type ChaincodeInstanceQueryRequest

type ChaincodeInstanceQueryRequest struct {
	Input *ChaincodeInput `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInstanceQueryRequest) Descriptor deprecated

func (*ChaincodeInstanceQueryRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInstanceQueryRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInstanceQueryRequest) GetInput

func (*ChaincodeInstanceQueryRequest) ProtoMessage

func (*ChaincodeInstanceQueryRequest) ProtoMessage()

func (*ChaincodeInstanceQueryRequest) ProtoReflect

func (*ChaincodeInstanceQueryRequest) Reset

func (x *ChaincodeInstanceQueryRequest) Reset()

func (*ChaincodeInstanceQueryRequest) String

func (*ChaincodeInstanceQueryRequest) Validate

func (this *ChaincodeInstanceQueryRequest) Validate() error

type ChaincodeInstanceService

type ChaincodeInstanceService struct {
	SDK     sdk.SDK
	Locator *ChaincodeLocator
	Opts    *Opts
}

func NewChaincodeInstanceService

func NewChaincodeInstanceService(sdk sdk.SDK, locator *ChaincodeLocator, opts ...Opt) *ChaincodeInstanceService

func (*ChaincodeInstanceService) EventService

func (*ChaincodeInstanceService) Events

func (*ChaincodeInstanceService) EventsChan

func (cis *ChaincodeInstanceService) EventsChan(
	ctx context.Context, rr ...*ChaincodeInstanceEventsStreamRequest) (_ chan *ChaincodeEvent, closer func() error, _ error)

func (*ChaincodeInstanceService) Exec

func (*ChaincodeInstanceService) Invoke

func (*ChaincodeInstanceService) Query

func (*ChaincodeInstanceService) ServiceDef

func (cis *ChaincodeInstanceService) ServiceDef() ServiceDef

type ChaincodeInstanceServiceClient

type ChaincodeInstanceServiceClient interface {
	// Exec: Query or Invoke
	Exec(ctx context.Context, in *ChaincodeInstanceExecRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Query chaincode on home peer. Do NOT send to orderer.
	Query(ctx context.Context, in *ChaincodeInstanceQueryRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Invoke chaincode on peers, according to endorsement policy and the SEND to orderer
	Invoke(ctx context.Context, in *ChaincodeInstanceInvokeRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Chaincode events stream
	EventsStream(ctx context.Context, in *ChaincodeInstanceEventsStreamRequest, opts ...grpc.CallOption) (ChaincodeInstanceService_EventsStreamClient, error)
	// Chaincode events
	Events(ctx context.Context, in *ChaincodeInstanceEventsRequest, opts ...grpc.CallOption) (*ChaincodeEvents, error)
}

ChaincodeInstanceServiceClient is the client API for ChaincodeInstanceService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ChaincodeInstanceServiceInvoker

type ChaincodeInstanceServiceInvoker struct {
	ChaincodeInstance ChaincodeInstanceServiceServer
	Serializer        serialize.Serializer
}

ChaincodeInvoker used in generated service gateway code

func NewChaincodeInstanceServiceInvoker

func NewChaincodeInstanceServiceInvoker(
	ccInstance ChaincodeInstanceServiceServer, opts ...InvokerOpt) *ChaincodeInstanceServiceInvoker

NewChaincodeInstanceServiceInvoker

func (*ChaincodeInstanceServiceInvoker) Invoke

func (c *ChaincodeInstanceServiceInvoker) Invoke(
	ctx context.Context, fn string, args []interface{}, target interface{}) (interface{}, error)

func (*ChaincodeInstanceServiceInvoker) Query

func (c *ChaincodeInstanceServiceInvoker) Query(
	ctx context.Context, fn string, args []interface{}, target interface{}) (interface{}, error)

type ChaincodeInstanceServiceServer

type ChaincodeInstanceServiceServer interface {
	// Exec: Query or Invoke
	Exec(context.Context, *ChaincodeInstanceExecRequest) (*peer.Response, error)
	// Query chaincode on home peer. Do NOT send to orderer.
	Query(context.Context, *ChaincodeInstanceQueryRequest) (*peer.Response, error)
	// Invoke chaincode on peers, according to endorsement policy and the SEND to orderer
	Invoke(context.Context, *ChaincodeInstanceInvokeRequest) (*peer.Response, error)
	// Chaincode events stream
	EventsStream(*ChaincodeInstanceEventsStreamRequest, ChaincodeInstanceService_EventsStreamServer) error
	// Chaincode events
	Events(context.Context, *ChaincodeInstanceEventsRequest) (*ChaincodeEvents, error)
}

ChaincodeInstanceServiceServer is the server API for ChaincodeInstanceService service.

type ChaincodeInstanceService_EventsStreamClient

type ChaincodeInstanceService_EventsStreamClient interface {
	Recv() (*ChaincodeEvent, error)
	grpc.ClientStream
}

type ChaincodeInstanceService_EventsStreamServer

type ChaincodeInstanceService_EventsStreamServer interface {
	Send(*ChaincodeEvent) error
	grpc.ServerStream
}

type ChaincodeInvokeRequest

type ChaincodeInvokeRequest struct {
	Locator *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	Input   *ChaincodeInput   `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeInvokeRequest) Descriptor deprecated

func (*ChaincodeInvokeRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeInvokeRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeInvokeRequest) GetInput

func (x *ChaincodeInvokeRequest) GetInput() *ChaincodeInput

func (*ChaincodeInvokeRequest) GetLocator

func (x *ChaincodeInvokeRequest) GetLocator() *ChaincodeLocator

func (*ChaincodeInvokeRequest) ProtoMessage

func (*ChaincodeInvokeRequest) ProtoMessage()

func (*ChaincodeInvokeRequest) ProtoReflect

func (x *ChaincodeInvokeRequest) ProtoReflect() protoreflect.Message

func (*ChaincodeInvokeRequest) Reset

func (x *ChaincodeInvokeRequest) Reset()

func (*ChaincodeInvokeRequest) String

func (x *ChaincodeInvokeRequest) String() string

func (*ChaincodeInvokeRequest) Validate

func (this *ChaincodeInvokeRequest) Validate() error

type ChaincodeLocator

type ChaincodeLocator struct {

	// Chaincode name
	Chaincode string `protobuf:"bytes,1,opt,name=chaincode,proto3" json:"chaincode,omitempty"`
	// Channel name
	Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"`
	// contains filtered or unexported fields
}

Chaincode locator - channel name and chaincode name

func (*ChaincodeLocator) Descriptor deprecated

func (*ChaincodeLocator) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeLocator.ProtoReflect.Descriptor instead.

func (*ChaincodeLocator) GetChaincode

func (x *ChaincodeLocator) GetChaincode() string

func (*ChaincodeLocator) GetChannel

func (x *ChaincodeLocator) GetChannel() string

func (*ChaincodeLocator) ProtoMessage

func (*ChaincodeLocator) ProtoMessage()

func (*ChaincodeLocator) ProtoReflect

func (x *ChaincodeLocator) ProtoReflect() protoreflect.Message

func (*ChaincodeLocator) Reset

func (x *ChaincodeLocator) Reset()

func (*ChaincodeLocator) String

func (x *ChaincodeLocator) String() string

func (*ChaincodeLocator) Validate

func (this *ChaincodeLocator) Validate() error

type ChaincodeLocatorResolver

type ChaincodeLocatorResolver func(ctx router.Context, serviceName string) (*ChaincodeLocator, error)

type ChaincodeQueryRequest

type ChaincodeQueryRequest struct {
	Locator *ChaincodeLocator `protobuf:"bytes,1,opt,name=locator,proto3" json:"locator,omitempty"`
	Input   *ChaincodeInput   `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*ChaincodeQueryRequest) Descriptor deprecated

func (*ChaincodeQueryRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChaincodeQueryRequest.ProtoReflect.Descriptor instead.

func (*ChaincodeQueryRequest) GetInput

func (x *ChaincodeQueryRequest) GetInput() *ChaincodeInput

func (*ChaincodeQueryRequest) GetLocator

func (x *ChaincodeQueryRequest) GetLocator() *ChaincodeLocator

func (*ChaincodeQueryRequest) ProtoMessage

func (*ChaincodeQueryRequest) ProtoMessage()

func (*ChaincodeQueryRequest) ProtoReflect

func (x *ChaincodeQueryRequest) ProtoReflect() protoreflect.Message

func (*ChaincodeQueryRequest) Reset

func (x *ChaincodeQueryRequest) Reset()

func (*ChaincodeQueryRequest) String

func (x *ChaincodeQueryRequest) String() string

func (*ChaincodeQueryRequest) Validate

func (this *ChaincodeQueryRequest) Validate() error

type ChaincodeService

type ChaincodeService struct {
	SDK          sdk.SDK
	EventService *ChaincodeEventService
}

func New deprecated

func New(sdk sdk.SDK) *ChaincodeService

Deprecated: use NewChaincodeService instead

func NewChaincodeService

func NewChaincodeService(sdk sdk.SDK) *ChaincodeService

func (*ChaincodeService) Events

func (*ChaincodeService) EventsChan

func (cs *ChaincodeService) EventsChan(
	ctx context.Context, req *ChaincodeEventsStreamRequest) (_ chan *ChaincodeEvent, closer func() error, _ error)

func (*ChaincodeService) EventsStream

func (*ChaincodeService) Exec

func (*ChaincodeService) InstanceService

func (cs *ChaincodeService) InstanceService(locator *ChaincodeLocator, opts ...Opt) *ChaincodeInstanceService

InstanceService returns ChaincodeInstanceService for current Peer interface and provided channel and chaincode name

func (*ChaincodeService) Invoke

func (*ChaincodeService) Query

func (*ChaincodeService) ServiceDef

func (cs *ChaincodeService) ServiceDef() ServiceDef

ServiceDef returns service definition

type ChaincodeServiceClient

type ChaincodeServiceClient interface {
	// Exec: Query or Invoke
	Exec(ctx context.Context, in *ChaincodeExecRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Query chaincode on home peer. Do NOT send to orderer.
	Query(ctx context.Context, in *ChaincodeQueryRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Invoke chaincode on peers, according to endorsement policy and the SEND to orderer
	Invoke(ctx context.Context, in *ChaincodeInvokeRequest, opts ...grpc.CallOption) (*peer.Response, error)
	// Chaincode events stream
	EventsStream(ctx context.Context, in *ChaincodeEventsStreamRequest, opts ...grpc.CallOption) (ChaincodeService_EventsStreamClient, error)
	// Chaincode events
	Events(ctx context.Context, in *ChaincodeEventsRequest, opts ...grpc.CallOption) (*ChaincodeEvents, error)
}

ChaincodeServiceClient is the client API for ChaincodeService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ChaincodeServiceServer

type ChaincodeServiceServer interface {
	// Exec: Query or Invoke
	Exec(context.Context, *ChaincodeExecRequest) (*peer.Response, error)
	// Query chaincode on home peer. Do NOT send to orderer.
	Query(context.Context, *ChaincodeQueryRequest) (*peer.Response, error)
	// Invoke chaincode on peers, according to endorsement policy and the SEND to orderer
	Invoke(context.Context, *ChaincodeInvokeRequest) (*peer.Response, error)
	// Chaincode events stream
	EventsStream(*ChaincodeEventsStreamRequest, ChaincodeService_EventsStreamServer) error
	// Chaincode events
	Events(context.Context, *ChaincodeEventsRequest) (*ChaincodeEvents, error)
}

ChaincodeServiceServer is the server API for ChaincodeService service.

type ChaincodeService_EventsStreamClient

type ChaincodeService_EventsStreamClient interface {
	Recv() (*ChaincodeEvent, error)
	grpc.ClientStream
}

type ChaincodeService_EventsStreamServer

type ChaincodeService_EventsStreamServer interface {
	Send(*ChaincodeEvent) error
	grpc.ServerStream
}

type ChaincodeStubInvoker

type ChaincodeStubInvoker interface {
	Query(stub shim.ChaincodeStubInterface, fn string, args []interface{}, target interface{}) (interface{}, error)
}

ChaincodeStubInvoker for cross chaincode calls - only query (read) methods context argument is router.Context, not context.Context

type ContextOpt

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

type EventOpt

type EventOpt func(event *ChaincodeEvent) error

type InputOpt

type InputOpt func(ctx context.Context, input *ChaincodeInput) error

type InstanceOpts

type InstanceOpts struct {
	Locator *ChaincodeLocator
	Opts    Opts
}

type InvocationType

type InvocationType int32

Chaincode invocation type

const (
	// Simulation
	InvocationType_INVOCATION_TYPE_QUERY InvocationType = 0
	// Simulation and applying to ledger
	InvocationType_INVOCATION_TYPE_INVOKE InvocationType = 1
)

func (InvocationType) Descriptor

func (InvocationType) Enum

func (x InvocationType) Enum() *InvocationType

func (InvocationType) EnumDescriptor deprecated

func (InvocationType) EnumDescriptor() ([]byte, []int)

Deprecated: Use InvocationType.Descriptor instead.

func (InvocationType) Number

func (InvocationType) String

func (x InvocationType) String() string

func (InvocationType) Type

type InvokerOpt added in v1.0.2

type InvokerOpt func(*ChaincodeInstanceServiceInvoker)

func WithInvokerSerializer added in v1.0.2

func WithInvokerSerializer(s serialize.Serializer) InvokerOpt

type LocatorChaincodeStubInvoker

type LocatorChaincodeStubInvoker struct {
	Locator    *ChaincodeLocator
	Serializer serialize.Serializer
}

func (*LocatorChaincodeStubInvoker) Query

func (c *LocatorChaincodeStubInvoker) Query(
	stub shim.ChaincodeStubInterface, fn string, args []interface{}, target interface{}) (interface{}, error)

type Opt

type Opt func(*Opts)

func WithArgsEncryption

func WithArgsEncryption(encKey []byte) Opt

func WithDefaultSigner

func WithDefaultSigner(defaultSigner msp.SigningIdentity) Opt

func WithDefaultTransientMapValue

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

func WithEncryption

func WithEncryption(encKey []byte) Opt

func WithEventDecryption

func WithEventDecryption(encKey []byte) Opt

func WithEventResolver

func WithEventResolver(resolver mapping.EventResolver, fromBytesConverter serialize.FromBytesConverter) Opt

func WithInvokePayloadDecryption

func WithInvokePayloadDecryption(encKey []byte) Opt

type Opts

type Opts struct {
	Context []ContextOpt
	Input   []InputOpt
	Output  []OutputOpt
	Event   []EventOpt
}

type OutputOpt

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

type RawJson

type RawJson struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*RawJson) Descriptor deprecated

func (*RawJson) Descriptor() ([]byte, []int)

Deprecated: Use RawJson.ProtoReflect.Descriptor instead.

func (*RawJson) GetValue

func (x *RawJson) GetValue() []byte

func (*RawJson) MarshalJSON

func (x *RawJson) MarshalJSON() ([]byte, error)

func (*RawJson) MarshalJSONPB

func (x *RawJson) MarshalJSONPB(_ *jsonpb.Marshaler) ([]byte, error)

func (*RawJson) ProtoMessage

func (*RawJson) ProtoMessage()

func (*RawJson) ProtoReflect

func (x *RawJson) ProtoReflect() protoreflect.Message

func (*RawJson) Reset

func (x *RawJson) Reset()

func (*RawJson) String

func (x *RawJson) String() string

func (*RawJson) Validate

func (this *RawJson) Validate() error

type RegisterHandlerFromEndpoint

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

type Service

type Service interface {
	Name() string
	Swagger() []byte
	GRPCDesc() *grpc.ServiceDesc
	Impl() interface{}
	GRPCGatewayRegister() 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
	// contains filtered or unexported fields
}

func NewServiceDef

func NewServiceDef(name string, swagger []byte, desc *grpc.ServiceDesc, service interface{}, registerHandler RegisterHandlerFromEndpoint) ServiceDef

func (ServiceDef) GRPCDesc

func (s ServiceDef) GRPCDesc() *grpc.ServiceDesc

func (ServiceDef) GRPCGatewayRegister

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

func (ServiceDef) Impl

func (s ServiceDef) Impl() interface{}

func (ServiceDef) Name

func (s ServiceDef) Name() string

func (ServiceDef) Swagger

func (s ServiceDef) Swagger() []byte

type UnimplementedChaincodeEventsServiceServer

type UnimplementedChaincodeEventsServiceServer struct {
}

UnimplementedChaincodeEventsServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeEventsServiceServer) Events

type UnimplementedChaincodeInstanceEventsServiceServer

type UnimplementedChaincodeInstanceEventsServiceServer struct {
}

UnimplementedChaincodeInstanceEventsServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeInstanceEventsServiceServer) Events

type UnimplementedChaincodeInstanceServiceServer

type UnimplementedChaincodeInstanceServiceServer struct {
}

UnimplementedChaincodeInstanceServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeInstanceServiceServer) Events

func (*UnimplementedChaincodeInstanceServiceServer) Exec

func (*UnimplementedChaincodeInstanceServiceServer) Invoke

func (*UnimplementedChaincodeInstanceServiceServer) Query

type UnimplementedChaincodeServiceServer

type UnimplementedChaincodeServiceServer struct {
}

UnimplementedChaincodeServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedChaincodeServiceServer) Events

func (*UnimplementedChaincodeServiceServer) Exec

func (*UnimplementedChaincodeServiceServer) Invoke

func (*UnimplementedChaincodeServiceServer) Query

Directories

Path Synopsis
Deprecated: use github.com/hyperledger-labs/cckit/gateway package
Deprecated: use github.com/hyperledger-labs/cckit/gateway package

Jump to

Keyboard shortcuts

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