Documentation ¶
Overview ¶
Package cpaper_proxy 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 cpaper_proxy is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func NewCCWithLocalCpaper() (*router.Chaincode, error)
- func NewCCWithRemoteCpaper() (*router.Chaincode, error)
- func RegisterCPaperProxyServiceChaincode(r *cckit_router.Group, cc CPaperProxyServiceChaincode) error
- func RegisterCPaperProxyServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCPaperProxyServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CPaperProxyServiceClient) error
- func RegisterCPaperProxyServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCPaperProxyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CPaperProxyServiceServer) error
- func RegisterCPaperProxyServiceServer(s *grpc.Server, srv CPaperProxyServiceServer)
- type CPaperProxyService
- type CPaperProxyServiceChaincode
- type CPaperProxyServiceChaincodeLocalResolver
- type CPaperProxyServiceChaincodeLocatorResolver
- type CPaperProxyServiceChaincodeResolver
- type CPaperProxyServiceChaincodeStubInvoker
- type CPaperProxyServiceClient
- type CPaperProxyServiceGateway
- type CPaperProxyServiceServer
- type Id
- type InfoFromCPaper
- func (*InfoFromCPaper) Descriptor() ([]byte, []int)deprecated
- func (x *InfoFromCPaper) GetIssuer() string
- func (x *InfoFromCPaper) GetOwner() string
- func (x *InfoFromCPaper) GetPaperNumber() string
- func (*InfoFromCPaper) ProtoMessage()
- func (x *InfoFromCPaper) ProtoReflect() protoreflect.Message
- func (x *InfoFromCPaper) Reset()
- func (x *InfoFromCPaper) String() string
- func (this *InfoFromCPaper) Validate() error
- type UnimplementedCPaperProxyServiceServer
Constants ¶
const ( // CPaperProxyServiceChaincodeMethodPrefix allows to use multiple services with same method names in one chaincode CPaperProxyServiceChaincodeMethodPrefix = "" CPaperProxyServiceChaincode_GetFromCPaper = CPaperProxyServiceChaincodeMethodPrefix + "GetFromCPaper" )
CPaperProxyServiceChaincode method names
Variables ¶
var CPaperProxyServiceSwagger []byte
var File_cpaper_proxy_cpaper_proxy_proto protoreflect.FileDescriptor
Functions ¶
func NewCCWithLocalCpaper ¶
func NewCCWithRemoteCpaper ¶
func RegisterCPaperProxyServiceChaincode ¶
func RegisterCPaperProxyServiceChaincode(r *cckit_router.Group, cc CPaperProxyServiceChaincode) error
RegisterCPaperProxyServiceChaincode registers service methods as chaincode router handlers
func RegisterCPaperProxyServiceHandler ¶
func RegisterCPaperProxyServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterCPaperProxyServiceHandler registers the http handlers for service CPaperProxyService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCPaperProxyServiceHandlerClient ¶
func RegisterCPaperProxyServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CPaperProxyServiceClient) error
RegisterCPaperProxyServiceHandlerClient registers the http handlers for service CPaperProxyService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CPaperProxyServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CPaperProxyServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CPaperProxyServiceClient" to call the correct interceptors.
func RegisterCPaperProxyServiceHandlerFromEndpoint ¶
func RegisterCPaperProxyServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCPaperProxyServiceHandlerFromEndpoint is same as RegisterCPaperProxyServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCPaperProxyServiceHandlerServer ¶
func RegisterCPaperProxyServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CPaperProxyServiceServer) error
RegisterCPaperProxyServiceHandlerServer registers the http handlers for service CPaperProxyService to "mux". UnaryRPC :call CPaperProxyServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterCPaperProxyServiceServer ¶
func RegisterCPaperProxyServiceServer(s *grpc.Server, srv CPaperProxyServiceServer)
Types ¶
type CPaperProxyService ¶
type CPaperProxyService struct {
CPaperServiceResolver cpservice.CPaperServiceChaincodeResolver
}
func NewServiceWithLocalCPaperResolver ¶
func NewServiceWithLocalCPaperResolver(cpaperService cpservice.CPaperServiceChaincode) *CPaperProxyService
NewServiceWithLocalCPaperResolver - crosscc service and cpaper service in one chaincode
func NewServiceWithRemoteCPaperResolver ¶
func NewServiceWithRemoteCPaperResolver(setting crosscc.SettingServiceChaincode) *CPaperProxyService
func (*CPaperProxyService) GetFromCPaper ¶
func (c *CPaperProxyService) GetFromCPaper(ctx router.Context, id *Id) (*InfoFromCPaper, error)
type CPaperProxyServiceChaincode ¶
type CPaperProxyServiceChaincode interface {
GetFromCPaper(cckit_router.Context, *Id) (*InfoFromCPaper, error)
}
CPaperProxyServiceChaincode chaincode methods interface
type CPaperProxyServiceChaincodeLocalResolver ¶
type CPaperProxyServiceChaincodeLocalResolver struct {
// contains filtered or unexported fields
}
CPaperProxyServiceChaincodeResolver interface for service resolver
func NewCPaperProxyServiceChaincodeLocalResolver ¶
func NewCPaperProxyServiceChaincodeLocalResolver(service CPaperProxyServiceChaincode) *CPaperProxyServiceChaincodeLocalResolver
func (*CPaperProxyServiceChaincodeLocalResolver) Resolve ¶
func (r *CPaperProxyServiceChaincodeLocalResolver) Resolve(ctx cckit_router.Context) (CPaperProxyServiceChaincode, error)
type CPaperProxyServiceChaincodeLocatorResolver ¶
type CPaperProxyServiceChaincodeLocatorResolver struct {
// contains filtered or unexported fields
}
CPaperProxyServiceChaincodeResolver interface for service resolver
func NewCPaperProxyServiceChaincodeResolver ¶
func NewCPaperProxyServiceChaincodeResolver(locatorResolver cckit_gateway.ChaincodeLocatorResolver) *CPaperProxyServiceChaincodeLocatorResolver
func (*CPaperProxyServiceChaincodeLocatorResolver) Resolve ¶
func (r *CPaperProxyServiceChaincodeLocatorResolver) Resolve(ctx cckit_router.Context) (CPaperProxyServiceChaincode, error)
type CPaperProxyServiceChaincodeResolver ¶
type CPaperProxyServiceChaincodeResolver interface {
Resolve(ctx cckit_router.Context) (CPaperProxyServiceChaincode, error)
}
CPaperProxyServiceChaincodeResolver interface for service resolver
type CPaperProxyServiceChaincodeStubInvoker ¶
type CPaperProxyServiceChaincodeStubInvoker struct {
Invoker cckit_gateway.ChaincodeStubInvoker
}
func NewCPaperProxyServiceChaincodeStubInvoker ¶
func NewCPaperProxyServiceChaincodeStubInvoker(locator *cckit_gateway.ChaincodeLocator) *CPaperProxyServiceChaincodeStubInvoker
func (*CPaperProxyServiceChaincodeStubInvoker) GetFromCPaper ¶
func (c *CPaperProxyServiceChaincodeStubInvoker) GetFromCPaper(ctx cckit_router.Context, in *Id) (*InfoFromCPaper, error)
type CPaperProxyServiceClient ¶
type CPaperProxyServiceClient interface { // List method returns all registered commercial papers GetFromCPaper(ctx context.Context, in *Id, opts ...grpc.CallOption) (*InfoFromCPaper, error) }
CPaperProxyServiceClient is the client API for CPaperProxyService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCPaperProxyServiceClient ¶
func NewCPaperProxyServiceClient(cc grpc.ClientConnInterface) CPaperProxyServiceClient
type CPaperProxyServiceGateway ¶
type CPaperProxyServiceGateway 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 NewCPaperProxyServiceGateway ¶
func NewCPaperProxyServiceGateway(sdk cckit_sdk.SDK, channel, chaincode string, opts ...cckit_gateway.Opt) *CPaperProxyServiceGateway
NewCPaperProxyServiceGateway creates gateway to access chaincode method via chaincode service
func NewCPaperProxyServiceGatewayFromInstance ¶
func NewCPaperProxyServiceGatewayFromInstance(chaincodeInstance cckit_gateway.ChaincodeInstance) *CPaperProxyServiceGateway
func (*CPaperProxyServiceGateway) GetFromCPaper ¶
func (c *CPaperProxyServiceGateway) GetFromCPaper(ctx context.Context, in *Id) (*InfoFromCPaper, error)
func (*CPaperProxyServiceGateway) Invoker ¶
func (c *CPaperProxyServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
func (*CPaperProxyServiceGateway) ServiceDef ¶
func (c *CPaperProxyServiceGateway) ServiceDef() cckit_gateway.ServiceDef
ServiceDef returns service definition
type CPaperProxyServiceServer ¶
type CPaperProxyServiceServer interface { // List method returns all registered commercial papers GetFromCPaper(context.Context, *Id) (*InfoFromCPaper, error) }
CPaperProxyServiceServer is the server API for CPaperProxyService service.
type Id ¶
type Id struct { Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` PaperNumber string `protobuf:"bytes,2,opt,name=paper_number,json=paperNumber,proto3" json:"paper_number,omitempty"` // contains filtered or unexported fields }
func (*Id) Descriptor
deprecated
func (*Id) GetPaperNumber ¶
func (*Id) ProtoMessage ¶
func (*Id) ProtoMessage()
func (*Id) ProtoReflect ¶
func (x *Id) ProtoReflect() protoreflect.Message
type InfoFromCPaper ¶
type InfoFromCPaper struct { Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"` PaperNumber string `protobuf:"bytes,2,opt,name=paper_number,json=paperNumber,proto3" json:"paper_number,omitempty"` Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` // contains filtered or unexported fields }
func (*InfoFromCPaper) Descriptor
deprecated
func (*InfoFromCPaper) Descriptor() ([]byte, []int)
Deprecated: Use InfoFromCPaper.ProtoReflect.Descriptor instead.
func (*InfoFromCPaper) GetIssuer ¶
func (x *InfoFromCPaper) GetIssuer() string
func (*InfoFromCPaper) GetOwner ¶
func (x *InfoFromCPaper) GetOwner() string
func (*InfoFromCPaper) GetPaperNumber ¶
func (x *InfoFromCPaper) GetPaperNumber() string
func (*InfoFromCPaper) ProtoMessage ¶
func (*InfoFromCPaper) ProtoMessage()
func (*InfoFromCPaper) ProtoReflect ¶
func (x *InfoFromCPaper) ProtoReflect() protoreflect.Message
func (*InfoFromCPaper) Reset ¶
func (x *InfoFromCPaper) Reset()
func (*InfoFromCPaper) String ¶
func (x *InfoFromCPaper) String() string
func (*InfoFromCPaper) Validate ¶
func (this *InfoFromCPaper) Validate() error
type UnimplementedCPaperProxyServiceServer ¶
type UnimplementedCPaperProxyServiceServer struct { }
UnimplementedCPaperProxyServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedCPaperProxyServiceServer) GetFromCPaper ¶
func (*UnimplementedCPaperProxyServiceServer) GetFromCPaper(context.Context, *Id) (*InfoFromCPaper, error)