Documentation ¶
Overview ¶
Package pinger contains
- chaincode methods names {service_name}Chaincode_{method_name}
- chaincode interface definition {service_name}Chaincode
- chaincode gateway definition {service_name}}Gateway
- chaincode service to cckit router registration func
Package pinger is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Package pinger contains structure and functions for checking chain code accessibility
Index ¶
- Constants
- Variables
- func Ping(ctx r.Context) (interface{}, error)
- func RegisterChaincodePingerServiceChaincode(r *cckit_router.Group, cc ChaincodePingerServiceChaincode) error
- func RegisterChaincodePingerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterChaincodePingerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterChaincodePingerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterChaincodePingerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterChaincodePingerServiceServer(s *grpc.Server, srv ChaincodePingerServiceServer)
- type ChaincodePinger
- type ChaincodePingerServiceChaincode
- type ChaincodePingerServiceClient
- type ChaincodePingerServiceGateway
- type ChaincodePingerServiceServer
- type PingInfo
- func (*PingInfo) Descriptor() ([]byte, []int)deprecated
- func (x *PingInfo) GetEndorsingServerTime() *timestamppb.Timestamp
- func (x *PingInfo) GetInvokerCert() []byte
- func (x *PingInfo) GetInvokerId() string
- func (x *PingInfo) GetTxTime() *timestamppb.Timestamp
- func (*PingInfo) ProtoMessage()
- func (x *PingInfo) ProtoReflect() protoreflect.Message
- func (x *PingInfo) Reset()
- func (x *PingInfo) String() string
- func (this *PingInfo) Validate() error
- type UnimplementedChaincodePingerServiceServer
Constants ¶
const ( // ChaincodePingerServiceChaincodeMethodPrefix allows to use multiple services with same method names in one chaincode ChaincodePingerServiceChaincodeMethodPrefix = "ChaincodePingerService." ChaincodePingerServiceChaincode_Ping = ChaincodePingerServiceChaincodeMethodPrefix + "Ping" )
ChaincodePingerServiceChaincode method names
const ( // PingKeyPrefix prefix for PingInfo composite key in chain code state PingKeyPrefix = `PING` // PingEvent event name PingEvent = `PING` // FuncPingConstant func name FuncPingConstant = `pingLocal` // FuncPing func name FuncPing = `ping` // FuncPings func name FuncPings = `pings` )
Variables ¶
var ChaincodePingerServiceSwagger []byte
var File_pinger_chaincode_pinger_proto protoreflect.FileDescriptor
Functions ¶
func RegisterChaincodePingerServiceChaincode ¶
func RegisterChaincodePingerServiceChaincode(r *cckit_router.Group, cc ChaincodePingerServiceChaincode) error
RegisterChaincodePingerServiceChaincode registers service methods as chaincode router handlers
func RegisterChaincodePingerServiceHandler ¶
func RegisterChaincodePingerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterChaincodePingerServiceHandler registers the http handlers for service ChaincodePingerService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterChaincodePingerServiceHandlerClient ¶
func RegisterChaincodePingerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ChaincodePingerServiceClient) error
RegisterChaincodePingerServiceHandlerClient registers the http handlers for service ChaincodePingerService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ChaincodePingerServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ChaincodePingerServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ChaincodePingerServiceClient" to call the correct interceptors.
func RegisterChaincodePingerServiceHandlerFromEndpoint ¶
func RegisterChaincodePingerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterChaincodePingerServiceHandlerFromEndpoint is same as RegisterChaincodePingerServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterChaincodePingerServiceHandlerServer ¶
func RegisterChaincodePingerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ChaincodePingerServiceServer) error
RegisterChaincodePingerServiceHandlerServer registers the http handlers for service ChaincodePingerService to "mux". UnaryRPC :call ChaincodePingerServiceServer 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 RegisterChaincodePingerServiceHandlerFromEndpoint instead.
func RegisterChaincodePingerServiceServer ¶
func RegisterChaincodePingerServiceServer(s *grpc.Server, srv ChaincodePingerServiceServer)
Types ¶
type ChaincodePinger ¶
type ChaincodePinger struct{}
func NewService ¶
func NewService() *ChaincodePinger
type ChaincodePingerServiceChaincode ¶
type ChaincodePingerServiceChaincode interface {
Ping(cckit_router.Context, *emptypb.Empty) (*PingInfo, error)
}
ChaincodePingerServiceChaincode chaincode methods interface
type ChaincodePingerServiceClient ¶
type ChaincodePingerServiceClient interface { // ping chaincode Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PingInfo, error) }
ChaincodePingerServiceClient is the client API for ChaincodePingerService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewChaincodePingerServiceClient ¶
func NewChaincodePingerServiceClient(cc grpc.ClientConnInterface) ChaincodePingerServiceClient
type ChaincodePingerServiceGateway ¶
type ChaincodePingerServiceGateway struct {
ChaincodeInstance cckit_gateway.ChaincodeInstance
}
gateway implementation gateway can be used as kind of SDK, GRPC or REST server ( via grpc-gateway or clay )
func NewChaincodePingerServiceGateway ¶
func NewChaincodePingerServiceGateway(sdk cckit_sdk.SDK, channel, chaincode string, opts ...cckit_gateway.Opt) *ChaincodePingerServiceGateway
NewChaincodePingerServiceGateway creates gateway to access chaincode method via chaincode service
func NewChaincodePingerServiceGatewayFromInstance ¶
func NewChaincodePingerServiceGatewayFromInstance(chaincodeInstance cckit_gateway.ChaincodeInstance) *ChaincodePingerServiceGateway
func (*ChaincodePingerServiceGateway) Invoker ¶
func (c *ChaincodePingerServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
func (*ChaincodePingerServiceGateway) ServiceDef ¶
func (c *ChaincodePingerServiceGateway) ServiceDef() cckit_gateway.ServiceDef
ServiceDef returns service definition
type ChaincodePingerServiceServer ¶
type ChaincodePingerServiceServer interface { // ping chaincode Ping(context.Context, *emptypb.Empty) (*PingInfo, error) }
ChaincodePingerServiceServer is the server API for ChaincodePingerService service.
type PingInfo ¶
type PingInfo struct { InvokerId string `protobuf:"bytes,1,opt,name=invoker_id,json=invokerId,proto3" json:"invoker_id,omitempty"` InvokerCert []byte `protobuf:"bytes,2,opt,name=invoker_cert,json=invokerCert,proto3" json:"invoker_cert,omitempty"` EndorsingServerTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=endorsing_server_time,json=endorsingServerTime,proto3" json:"endorsing_server_time,omitempty"` TxTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=tx_time,json=txTime,proto3" json:"tx_time,omitempty"` // contains filtered or unexported fields }
stores time and certificate of ping tx creator
func (*PingInfo) Descriptor
deprecated
func (*PingInfo) GetEndorsingServerTime ¶
func (x *PingInfo) GetEndorsingServerTime() *timestamppb.Timestamp
func (*PingInfo) GetInvokerCert ¶
func (*PingInfo) GetInvokerId ¶
func (*PingInfo) GetTxTime ¶
func (x *PingInfo) GetTxTime() *timestamppb.Timestamp
func (*PingInfo) ProtoMessage ¶
func (*PingInfo) ProtoMessage()
func (*PingInfo) ProtoReflect ¶
func (x *PingInfo) ProtoReflect() protoreflect.Message
type UnimplementedChaincodePingerServiceServer ¶
type UnimplementedChaincodePingerServiceServer struct { }
UnimplementedChaincodePingerServiceServer can be embedded to have forward compatible implementations.