Documentation ¶
Overview ¶
Package cpaper_asservice 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_asservice is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func CCRouter(name string) (*router.Group, error)
- func Event(ctx router.Context) state.Event
- func NewCC() (*router.Chaincode, error)
- func NewCCEncrypted() (*router.Chaincode, error)
- func RegisterCPaperServiceChaincode(r *cckit_router.Group, cc CPaperServiceChaincode) error
- func RegisterCPaperServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCPaperServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CPaperServiceClient) error
- func RegisterCPaperServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCPaperServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CPaperServiceServer) error
- func RegisterCPaperServiceServer(s *grpc.Server, srv CPaperServiceServer)
- func State(ctx router.Context) m.MappedState
- type BuyCommercialPaper
- func (*BuyCommercialPaper) Descriptor() ([]byte, []int)deprecated
- func (x *BuyCommercialPaper) GetCurrentOwner() string
- func (x *BuyCommercialPaper) GetIssuer() string
- func (x *BuyCommercialPaper) GetNewOwner() string
- func (x *BuyCommercialPaper) GetPaperNumber() string
- func (x *BuyCommercialPaper) GetPrice() int32
- func (x *BuyCommercialPaper) GetPurchaseDate() *timestamppb.Timestamp
- func (*BuyCommercialPaper) ProtoMessage()
- func (x *BuyCommercialPaper) ProtoReflect() protoreflect.Message
- func (x *BuyCommercialPaper) Reset()
- func (x *BuyCommercialPaper) String() string
- func (this *BuyCommercialPaper) Validate() error
- type CPaperService
- func (cc *CPaperService) Buy(ctx router.Context, buy *BuyCommercialPaper) (*CommercialPaper, error)
- func (cc *CPaperService) Delete(ctx router.Context, id *CommercialPaperId) (*CommercialPaper, error)
- func (cc *CPaperService) Get(ctx router.Context, id *CommercialPaperId) (*CommercialPaper, error)
- func (cc *CPaperService) GetByExternalId(ctx router.Context, id *ExternalId) (*CommercialPaper, error)
- func (cc *CPaperService) Issue(ctx router.Context, issue *IssueCommercialPaper) (*CommercialPaper, error)
- func (cc *CPaperService) List(ctx router.Context, in *empty.Empty) (*CommercialPaperList, error)
- func (cc *CPaperService) Redeem(ctx router.Context, redeem *RedeemCommercialPaper) (*CommercialPaper, error)
- type CPaperServiceChaincode
- type CPaperServiceChaincodeLocalResolver
- type CPaperServiceChaincodeLocatorResolver
- type CPaperServiceChaincodeResolver
- type CPaperServiceChaincodeStubInvoker
- func (c *CPaperServiceChaincodeStubInvoker) Buy(ctx cckit_router.Context, in *BuyCommercialPaper) (*CommercialPaper, error)
- func (c *CPaperServiceChaincodeStubInvoker) Delete(ctx cckit_router.Context, in *CommercialPaperId) (*CommercialPaper, error)
- func (c *CPaperServiceChaincodeStubInvoker) Get(ctx cckit_router.Context, in *CommercialPaperId) (*CommercialPaper, error)
- func (c *CPaperServiceChaincodeStubInvoker) GetByExternalId(ctx cckit_router.Context, in *ExternalId) (*CommercialPaper, error)
- func (c *CPaperServiceChaincodeStubInvoker) Issue(ctx cckit_router.Context, in *IssueCommercialPaper) (*CommercialPaper, error)
- func (c *CPaperServiceChaincodeStubInvoker) List(ctx cckit_router.Context, in *emptypb.Empty) (*CommercialPaperList, error)
- func (c *CPaperServiceChaincodeStubInvoker) Redeem(ctx cckit_router.Context, in *RedeemCommercialPaper) (*CommercialPaper, error)
- type CPaperServiceClient
- type CPaperServiceGateway
- func (c *CPaperServiceGateway) Buy(ctx context.Context, in *BuyCommercialPaper) (*CommercialPaper, error)
- func (c *CPaperServiceGateway) Delete(ctx context.Context, in *CommercialPaperId) (*CommercialPaper, error)
- func (c *CPaperServiceGateway) Get(ctx context.Context, in *CommercialPaperId) (*CommercialPaper, error)
- func (c *CPaperServiceGateway) GetByExternalId(ctx context.Context, in *ExternalId) (*CommercialPaper, error)
- func (c *CPaperServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
- func (c *CPaperServiceGateway) Issue(ctx context.Context, in *IssueCommercialPaper) (*CommercialPaper, error)
- func (c *CPaperServiceGateway) List(ctx context.Context, in *emptypb.Empty) (*CommercialPaperList, error)
- func (c *CPaperServiceGateway) Redeem(ctx context.Context, in *RedeemCommercialPaper) (*CommercialPaper, error)
- func (c *CPaperServiceGateway) ServiceDef() cckit_gateway.ServiceDef
- type CPaperServiceServer
- type CommercialPaper
- func (*CommercialPaper) Descriptor() ([]byte, []int)deprecated
- func (x *CommercialPaper) GetExternalId() string
- func (x *CommercialPaper) GetFaceValue() int32
- func (x *CommercialPaper) GetIssueDate() *timestamppb.Timestamp
- func (x *CommercialPaper) GetIssuer() string
- func (x *CommercialPaper) GetMaturityDate() *timestamppb.Timestamp
- func (x *CommercialPaper) GetOwner() string
- func (x *CommercialPaper) GetPaperNumber() string
- func (x *CommercialPaper) GetState() CommercialPaper_State
- func (*CommercialPaper) ProtoMessage()
- func (x *CommercialPaper) ProtoReflect() protoreflect.Message
- func (x *CommercialPaper) Reset()
- func (x *CommercialPaper) String() string
- func (this *CommercialPaper) Validate() error
- type CommercialPaperId
- func (*CommercialPaperId) Descriptor() ([]byte, []int)deprecated
- func (x *CommercialPaperId) GetIssuer() string
- func (x *CommercialPaperId) GetPaperNumber() string
- func (*CommercialPaperId) ProtoMessage()
- func (x *CommercialPaperId) ProtoReflect() protoreflect.Message
- func (x *CommercialPaperId) Reset()
- func (x *CommercialPaperId) String() string
- func (this *CommercialPaperId) Validate() error
- type CommercialPaperList
- func (*CommercialPaperList) Descriptor() ([]byte, []int)deprecated
- func (x *CommercialPaperList) GetItems() []*CommercialPaper
- func (*CommercialPaperList) ProtoMessage()
- func (x *CommercialPaperList) ProtoReflect() protoreflect.Message
- func (x *CommercialPaperList) Reset()
- func (x *CommercialPaperList) String() string
- func (this *CommercialPaperList) Validate() error
- type CommercialPaper_State
- func (CommercialPaper_State) Descriptor() protoreflect.EnumDescriptor
- func (x CommercialPaper_State) Enum() *CommercialPaper_State
- func (CommercialPaper_State) EnumDescriptor() ([]byte, []int)deprecated
- func (x CommercialPaper_State) Number() protoreflect.EnumNumber
- func (x CommercialPaper_State) String() string
- func (CommercialPaper_State) Type() protoreflect.EnumType
- type ExternalId
- type IssueCommercialPaper
- func (*IssueCommercialPaper) Descriptor() ([]byte, []int)deprecated
- func (x *IssueCommercialPaper) GetExternalId() string
- func (x *IssueCommercialPaper) GetFaceValue() int32
- func (x *IssueCommercialPaper) GetIssueDate() *timestamppb.Timestamp
- func (x *IssueCommercialPaper) GetIssuer() string
- func (x *IssueCommercialPaper) GetMaturityDate() *timestamppb.Timestamp
- func (x *IssueCommercialPaper) GetPaperNumber() string
- func (*IssueCommercialPaper) ProtoMessage()
- func (x *IssueCommercialPaper) ProtoReflect() protoreflect.Message
- func (x *IssueCommercialPaper) Reset()
- func (x *IssueCommercialPaper) String() string
- func (this *IssueCommercialPaper) Validate() error
- type RedeemCommercialPaper
- func (*RedeemCommercialPaper) Descriptor() ([]byte, []int)deprecated
- func (x *RedeemCommercialPaper) GetIssuer() string
- func (x *RedeemCommercialPaper) GetPaperNumber() string
- func (x *RedeemCommercialPaper) GetRedeemDate() *timestamppb.Timestamp
- func (x *RedeemCommercialPaper) GetRedeemingOwner() string
- func (*RedeemCommercialPaper) ProtoMessage()
- func (x *RedeemCommercialPaper) ProtoReflect() protoreflect.Message
- func (x *RedeemCommercialPaper) Reset()
- func (x *RedeemCommercialPaper) String() string
- func (this *RedeemCommercialPaper) Validate() error
- type UnimplementedCPaperServiceServer
- func (*UnimplementedCPaperServiceServer) Buy(context.Context, *BuyCommercialPaper) (*CommercialPaper, error)
- func (*UnimplementedCPaperServiceServer) Delete(context.Context, *CommercialPaperId) (*CommercialPaper, error)
- func (*UnimplementedCPaperServiceServer) Get(context.Context, *CommercialPaperId) (*CommercialPaper, error)
- func (*UnimplementedCPaperServiceServer) GetByExternalId(context.Context, *ExternalId) (*CommercialPaper, error)
- func (*UnimplementedCPaperServiceServer) Issue(context.Context, *IssueCommercialPaper) (*CommercialPaper, error)
- func (*UnimplementedCPaperServiceServer) List(context.Context, *emptypb.Empty) (*CommercialPaperList, error)
- func (*UnimplementedCPaperServiceServer) Redeem(context.Context, *RedeemCommercialPaper) (*CommercialPaper, error)
Constants ¶
const ( // CPaperServiceChaincodeMethodPrefix allows to use multiple services with same method names in one chaincode CPaperServiceChaincodeMethodPrefix = "" CPaperServiceChaincode_List = CPaperServiceChaincodeMethodPrefix + "List" CPaperServiceChaincode_Get = CPaperServiceChaincodeMethodPrefix + "Get" CPaperServiceChaincode_GetByExternalId = CPaperServiceChaincodeMethodPrefix + "GetByExternalId" CPaperServiceChaincode_Issue = CPaperServiceChaincodeMethodPrefix + "Issue" CPaperServiceChaincode_Buy = CPaperServiceChaincodeMethodPrefix + "Buy" CPaperServiceChaincode_Redeem = CPaperServiceChaincodeMethodPrefix + "Redeem" CPaperServiceChaincode_Delete = CPaperServiceChaincodeMethodPrefix + "Delete" )
CPaperServiceChaincode method names
Variables ¶
var ( CommercialPaper_State_name = map[int32]string{ 0: "STATE_ISSUED", 1: "STATE_TRADING", 2: "STATE_REDEEMED", } CommercialPaper_State_value = map[string]int32{ "STATE_ISSUED": 0, "STATE_TRADING": 1, "STATE_REDEEMED": 2, } )
Enum value maps for CommercialPaper_State.
var ( StateMappings = m.StateMappings{}. Add(&CommercialPaper{}, m.PKeySchema(&CommercialPaperId{}), m.List(&CommercialPaperList{}), m.UniqKey("ExternalId"), ) EventMappings = m.EventMappings{}. Add(&IssueCommercialPaper{}). Add(&BuyCommercialPaper{}). Add(&RedeemCommercialPaper{}) )
var CPaperServiceSwagger []byte
var File_cpaper_asservice_cpaper_proto protoreflect.FileDescriptor
Functions ¶
func NewCCEncrypted ¶
func RegisterCPaperServiceChaincode ¶ added in v0.10.1
func RegisterCPaperServiceChaincode(r *cckit_router.Group, cc CPaperServiceChaincode) error
RegisterCPaperServiceChaincode registers service methods as chaincode router handlers
func RegisterCPaperServiceHandler ¶ added in v0.10.1
func RegisterCPaperServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterCPaperServiceHandler registers the http handlers for service CPaperService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCPaperServiceHandlerClient ¶ added in v0.10.1
func RegisterCPaperServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CPaperServiceClient) error
RegisterCPaperServiceHandlerClient registers the http handlers for service CPaperService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CPaperServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CPaperServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CPaperServiceClient" to call the correct interceptors.
func RegisterCPaperServiceHandlerFromEndpoint ¶ added in v0.10.1
func RegisterCPaperServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCPaperServiceHandlerFromEndpoint is same as RegisterCPaperServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCPaperServiceHandlerServer ¶ added in v0.10.1
func RegisterCPaperServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CPaperServiceServer) error
RegisterCPaperServiceHandlerServer registers the http handlers for service CPaperService to "mux". UnaryRPC :call CPaperServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterCPaperServiceServer ¶ added in v0.10.1
func RegisterCPaperServiceServer(s *grpc.Server, srv CPaperServiceServer)
Types ¶
type BuyCommercialPaper ¶ added in v0.10.1
type BuyCommercialPaper 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"` CurrentOwner string `protobuf:"bytes,3,opt,name=current_owner,json=currentOwner,proto3" json:"current_owner,omitempty"` NewOwner string `protobuf:"bytes,4,opt,name=new_owner,json=newOwner,proto3" json:"new_owner,omitempty"` Price int32 `protobuf:"varint,5,opt,name=price,proto3" json:"price,omitempty"` PurchaseDate *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=purchase_date,json=purchaseDate,proto3" json:"purchase_date,omitempty"` // contains filtered or unexported fields }
BuyCommercialPaper event
func (*BuyCommercialPaper) Descriptor
deprecated
added in
v0.10.1
func (*BuyCommercialPaper) Descriptor() ([]byte, []int)
Deprecated: Use BuyCommercialPaper.ProtoReflect.Descriptor instead.
func (*BuyCommercialPaper) GetCurrentOwner ¶ added in v0.10.1
func (x *BuyCommercialPaper) GetCurrentOwner() string
func (*BuyCommercialPaper) GetIssuer ¶ added in v0.10.1
func (x *BuyCommercialPaper) GetIssuer() string
func (*BuyCommercialPaper) GetNewOwner ¶ added in v0.10.1
func (x *BuyCommercialPaper) GetNewOwner() string
func (*BuyCommercialPaper) GetPaperNumber ¶ added in v0.10.1
func (x *BuyCommercialPaper) GetPaperNumber() string
func (*BuyCommercialPaper) GetPrice ¶ added in v0.10.1
func (x *BuyCommercialPaper) GetPrice() int32
func (*BuyCommercialPaper) GetPurchaseDate ¶ added in v0.10.1
func (x *BuyCommercialPaper) GetPurchaseDate() *timestamppb.Timestamp
func (*BuyCommercialPaper) ProtoMessage ¶ added in v0.10.1
func (*BuyCommercialPaper) ProtoMessage()
func (*BuyCommercialPaper) ProtoReflect ¶ added in v0.10.1
func (x *BuyCommercialPaper) ProtoReflect() protoreflect.Message
func (*BuyCommercialPaper) Reset ¶ added in v0.10.1
func (x *BuyCommercialPaper) Reset()
func (*BuyCommercialPaper) String ¶ added in v0.10.1
func (x *BuyCommercialPaper) String() string
func (*BuyCommercialPaper) Validate ¶ added in v0.10.1
func (this *BuyCommercialPaper) Validate() error
type CPaperService ¶ added in v0.10.1
type CPaperService struct { }
func NewService ¶ added in v0.10.1
func NewService() *CPaperService
func (*CPaperService) Buy ¶ added in v0.10.1
func (cc *CPaperService) Buy(ctx router.Context, buy *BuyCommercialPaper) (*CommercialPaper, error)
func (*CPaperService) Delete ¶ added in v0.10.1
func (cc *CPaperService) Delete(ctx router.Context, id *CommercialPaperId) (*CommercialPaper, error)
func (*CPaperService) Get ¶ added in v0.10.1
func (cc *CPaperService) Get(ctx router.Context, id *CommercialPaperId) (*CommercialPaper, error)
func (*CPaperService) GetByExternalId ¶ added in v0.10.1
func (cc *CPaperService) GetByExternalId(ctx router.Context, id *ExternalId) (*CommercialPaper, error)
func (*CPaperService) Issue ¶ added in v0.10.1
func (cc *CPaperService) Issue(ctx router.Context, issue *IssueCommercialPaper) (*CommercialPaper, error)
func (*CPaperService) List ¶ added in v0.10.1
func (cc *CPaperService) List(ctx router.Context, in *empty.Empty) (*CommercialPaperList, error)
func (*CPaperService) Redeem ¶ added in v0.10.1
func (cc *CPaperService) Redeem(ctx router.Context, redeem *RedeemCommercialPaper) (*CommercialPaper, error)
type CPaperServiceChaincode ¶ added in v0.10.1
type CPaperServiceChaincode interface { List(cckit_router.Context, *emptypb.Empty) (*CommercialPaperList, error) Get(cckit_router.Context, *CommercialPaperId) (*CommercialPaper, error) GetByExternalId(cckit_router.Context, *ExternalId) (*CommercialPaper, error) Issue(cckit_router.Context, *IssueCommercialPaper) (*CommercialPaper, error) Buy(cckit_router.Context, *BuyCommercialPaper) (*CommercialPaper, error) Redeem(cckit_router.Context, *RedeemCommercialPaper) (*CommercialPaper, error) Delete(cckit_router.Context, *CommercialPaperId) (*CommercialPaper, error) }
CPaperServiceChaincode chaincode methods interface
type CPaperServiceChaincodeLocalResolver ¶ added in v0.10.1
type CPaperServiceChaincodeLocalResolver struct {
// contains filtered or unexported fields
}
CPaperServiceChaincodeResolver interface for service resolver
func NewCPaperServiceChaincodeLocalResolver ¶ added in v0.10.1
func NewCPaperServiceChaincodeLocalResolver(service CPaperServiceChaincode) *CPaperServiceChaincodeLocalResolver
func (*CPaperServiceChaincodeLocalResolver) Resolve ¶ added in v0.10.1
func (r *CPaperServiceChaincodeLocalResolver) Resolve(ctx cckit_router.Context) (CPaperServiceChaincode, error)
type CPaperServiceChaincodeLocatorResolver ¶ added in v0.10.1
type CPaperServiceChaincodeLocatorResolver struct {
// contains filtered or unexported fields
}
CPaperServiceChaincodeResolver interface for service resolver
func NewCPaperServiceChaincodeResolver ¶ added in v0.10.1
func NewCPaperServiceChaincodeResolver(locatorResolver cckit_gateway.ChaincodeLocatorResolver) *CPaperServiceChaincodeLocatorResolver
func (*CPaperServiceChaincodeLocatorResolver) Resolve ¶ added in v0.10.1
func (r *CPaperServiceChaincodeLocatorResolver) Resolve(ctx cckit_router.Context) (CPaperServiceChaincode, error)
type CPaperServiceChaincodeResolver ¶ added in v0.10.1
type CPaperServiceChaincodeResolver interface {
Resolve(ctx cckit_router.Context) (CPaperServiceChaincode, error)
}
CPaperServiceChaincodeResolver interface for service resolver
type CPaperServiceChaincodeStubInvoker ¶ added in v0.10.1
type CPaperServiceChaincodeStubInvoker struct {
Invoker cckit_gateway.ChaincodeStubInvoker
}
func NewCPaperServiceChaincodeStubInvoker ¶ added in v0.10.1
func NewCPaperServiceChaincodeStubInvoker(locator *cckit_gateway.ChaincodeLocator) *CPaperServiceChaincodeStubInvoker
func (*CPaperServiceChaincodeStubInvoker) Buy ¶ added in v0.10.1
func (c *CPaperServiceChaincodeStubInvoker) Buy(ctx cckit_router.Context, in *BuyCommercialPaper) (*CommercialPaper, error)
func (*CPaperServiceChaincodeStubInvoker) Delete ¶ added in v0.10.1
func (c *CPaperServiceChaincodeStubInvoker) Delete(ctx cckit_router.Context, in *CommercialPaperId) (*CommercialPaper, error)
func (*CPaperServiceChaincodeStubInvoker) Get ¶ added in v0.10.1
func (c *CPaperServiceChaincodeStubInvoker) Get(ctx cckit_router.Context, in *CommercialPaperId) (*CommercialPaper, error)
func (*CPaperServiceChaincodeStubInvoker) GetByExternalId ¶ added in v0.10.1
func (c *CPaperServiceChaincodeStubInvoker) GetByExternalId(ctx cckit_router.Context, in *ExternalId) (*CommercialPaper, error)
func (*CPaperServiceChaincodeStubInvoker) Issue ¶ added in v0.10.1
func (c *CPaperServiceChaincodeStubInvoker) Issue(ctx cckit_router.Context, in *IssueCommercialPaper) (*CommercialPaper, error)
func (*CPaperServiceChaincodeStubInvoker) List ¶ added in v0.10.1
func (c *CPaperServiceChaincodeStubInvoker) List(ctx cckit_router.Context, in *emptypb.Empty) (*CommercialPaperList, error)
func (*CPaperServiceChaincodeStubInvoker) Redeem ¶ added in v0.10.1
func (c *CPaperServiceChaincodeStubInvoker) Redeem(ctx cckit_router.Context, in *RedeemCommercialPaper) (*CommercialPaper, error)
type CPaperServiceClient ¶ added in v0.10.1
type CPaperServiceClient interface { // List method returns all registered commercial papers List(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CommercialPaperList, error) // Get method returns commercial paper data by id Get(ctx context.Context, in *CommercialPaperId, opts ...grpc.CallOption) (*CommercialPaper, error) // GetByExternalId GetByExternalId(ctx context.Context, in *ExternalId, opts ...grpc.CallOption) (*CommercialPaper, error) // Issue commercial paper Issue(ctx context.Context, in *IssueCommercialPaper, opts ...grpc.CallOption) (*CommercialPaper, error) // Buy commercial paper Buy(ctx context.Context, in *BuyCommercialPaper, opts ...grpc.CallOption) (*CommercialPaper, error) // Redeem commercial paper Redeem(ctx context.Context, in *RedeemCommercialPaper, opts ...grpc.CallOption) (*CommercialPaper, error) // Delete commercial paper Delete(ctx context.Context, in *CommercialPaperId, opts ...grpc.CallOption) (*CommercialPaper, error) }
CPaperServiceClient is the client API for CPaperService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCPaperServiceClient ¶ added in v0.10.1
func NewCPaperServiceClient(cc grpc.ClientConnInterface) CPaperServiceClient
type CPaperServiceGateway ¶ added in v0.10.1
type CPaperServiceGateway 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 NewCPaperServiceGateway ¶ added in v0.10.1
func NewCPaperServiceGateway(sdk cckit_sdk.SDK, channel, chaincode string, opts ...cckit_gateway.Opt) *CPaperServiceGateway
NewCPaperServiceGateway creates gateway to access chaincode method via chaincode service
func NewCPaperServiceGatewayFromInstance ¶ added in v0.10.1
func NewCPaperServiceGatewayFromInstance(chaincodeInstance cckit_gateway.ChaincodeInstance) *CPaperServiceGateway
func (*CPaperServiceGateway) Buy ¶ added in v0.10.1
func (c *CPaperServiceGateway) Buy(ctx context.Context, in *BuyCommercialPaper) (*CommercialPaper, error)
func (*CPaperServiceGateway) Delete ¶ added in v0.10.1
func (c *CPaperServiceGateway) Delete(ctx context.Context, in *CommercialPaperId) (*CommercialPaper, error)
func (*CPaperServiceGateway) Get ¶ added in v0.10.1
func (c *CPaperServiceGateway) Get(ctx context.Context, in *CommercialPaperId) (*CommercialPaper, error)
func (*CPaperServiceGateway) GetByExternalId ¶ added in v0.10.1
func (c *CPaperServiceGateway) GetByExternalId(ctx context.Context, in *ExternalId) (*CommercialPaper, error)
func (*CPaperServiceGateway) Invoker ¶ added in v0.10.1
func (c *CPaperServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker
func (*CPaperServiceGateway) Issue ¶ added in v0.10.1
func (c *CPaperServiceGateway) Issue(ctx context.Context, in *IssueCommercialPaper) (*CommercialPaper, error)
func (*CPaperServiceGateway) List ¶ added in v0.10.1
func (c *CPaperServiceGateway) List(ctx context.Context, in *emptypb.Empty) (*CommercialPaperList, error)
func (*CPaperServiceGateway) Redeem ¶ added in v0.10.1
func (c *CPaperServiceGateway) Redeem(ctx context.Context, in *RedeemCommercialPaper) (*CommercialPaper, error)
func (*CPaperServiceGateway) ServiceDef ¶ added in v0.10.1
func (c *CPaperServiceGateway) ServiceDef() cckit_gateway.ServiceDef
ServiceDef returns service definition
type CPaperServiceServer ¶ added in v0.10.1
type CPaperServiceServer interface { // List method returns all registered commercial papers List(context.Context, *emptypb.Empty) (*CommercialPaperList, error) // Get method returns commercial paper data by id Get(context.Context, *CommercialPaperId) (*CommercialPaper, error) // GetByExternalId GetByExternalId(context.Context, *ExternalId) (*CommercialPaper, error) // Issue commercial paper Issue(context.Context, *IssueCommercialPaper) (*CommercialPaper, error) // Buy commercial paper Buy(context.Context, *BuyCommercialPaper) (*CommercialPaper, error) // Redeem commercial paper Redeem(context.Context, *RedeemCommercialPaper) (*CommercialPaper, error) // Delete commercial paper Delete(context.Context, *CommercialPaperId) (*CommercialPaper, error) }
CPaperServiceServer is the server API for CPaperService service.
type CommercialPaper ¶ added in v0.10.1
type CommercialPaper struct { // Issuer and Paper number comprises composite primary key of Commercial paper entry 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"` IssueDate *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=issue_date,json=issueDate,proto3" json:"issue_date,omitempty"` MaturityDate *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=maturity_date,json=maturityDate,proto3" json:"maturity_date,omitempty"` FaceValue int32 `protobuf:"varint,6,opt,name=face_value,json=faceValue,proto3" json:"face_value,omitempty"` State CommercialPaper_State `protobuf:"varint,7,opt,name=state,proto3,enum=examples.cpaper_asservice.CommercialPaper_State" json:"state,omitempty"` // Additional unique field for entry ExternalId string `protobuf:"bytes,8,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` // contains filtered or unexported fields }
Commercial Paper state entry
func (*CommercialPaper) Descriptor
deprecated
added in
v0.10.1
func (*CommercialPaper) Descriptor() ([]byte, []int)
Deprecated: Use CommercialPaper.ProtoReflect.Descriptor instead.
func (*CommercialPaper) GetExternalId ¶ added in v0.10.1
func (x *CommercialPaper) GetExternalId() string
func (*CommercialPaper) GetFaceValue ¶ added in v0.10.1
func (x *CommercialPaper) GetFaceValue() int32
func (*CommercialPaper) GetIssueDate ¶ added in v0.10.1
func (x *CommercialPaper) GetIssueDate() *timestamppb.Timestamp
func (*CommercialPaper) GetIssuer ¶ added in v0.10.1
func (x *CommercialPaper) GetIssuer() string
func (*CommercialPaper) GetMaturityDate ¶ added in v0.10.1
func (x *CommercialPaper) GetMaturityDate() *timestamppb.Timestamp
func (*CommercialPaper) GetOwner ¶ added in v0.10.1
func (x *CommercialPaper) GetOwner() string
func (*CommercialPaper) GetPaperNumber ¶ added in v0.10.1
func (x *CommercialPaper) GetPaperNumber() string
func (*CommercialPaper) GetState ¶ added in v0.10.1
func (x *CommercialPaper) GetState() CommercialPaper_State
func (*CommercialPaper) ProtoMessage ¶ added in v0.10.1
func (*CommercialPaper) ProtoMessage()
func (*CommercialPaper) ProtoReflect ¶ added in v0.10.1
func (x *CommercialPaper) ProtoReflect() protoreflect.Message
func (*CommercialPaper) Reset ¶ added in v0.10.1
func (x *CommercialPaper) Reset()
func (*CommercialPaper) String ¶ added in v0.10.1
func (x *CommercialPaper) String() string
func (*CommercialPaper) Validate ¶ added in v0.10.1
func (this *CommercialPaper) Validate() error
type CommercialPaperId ¶ added in v0.10.1
type CommercialPaperId 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 }
CommercialPaperId identifier part
func (*CommercialPaperId) Descriptor
deprecated
added in
v0.10.1
func (*CommercialPaperId) Descriptor() ([]byte, []int)
Deprecated: Use CommercialPaperId.ProtoReflect.Descriptor instead.
func (*CommercialPaperId) GetIssuer ¶ added in v0.10.1
func (x *CommercialPaperId) GetIssuer() string
func (*CommercialPaperId) GetPaperNumber ¶ added in v0.10.1
func (x *CommercialPaperId) GetPaperNumber() string
func (*CommercialPaperId) ProtoMessage ¶ added in v0.10.1
func (*CommercialPaperId) ProtoMessage()
func (*CommercialPaperId) ProtoReflect ¶ added in v0.10.1
func (x *CommercialPaperId) ProtoReflect() protoreflect.Message
func (*CommercialPaperId) Reset ¶ added in v0.10.1
func (x *CommercialPaperId) Reset()
func (*CommercialPaperId) String ¶ added in v0.10.1
func (x *CommercialPaperId) String() string
func (*CommercialPaperId) Validate ¶ added in v0.10.1
func (this *CommercialPaperId) Validate() error
type CommercialPaperList ¶ added in v0.10.1
type CommercialPaperList struct { Items []*CommercialPaper `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
Container for returning multiple entities
func (*CommercialPaperList) Descriptor
deprecated
added in
v0.10.1
func (*CommercialPaperList) Descriptor() ([]byte, []int)
Deprecated: Use CommercialPaperList.ProtoReflect.Descriptor instead.
func (*CommercialPaperList) GetItems ¶ added in v0.10.1
func (x *CommercialPaperList) GetItems() []*CommercialPaper
func (*CommercialPaperList) ProtoMessage ¶ added in v0.10.1
func (*CommercialPaperList) ProtoMessage()
func (*CommercialPaperList) ProtoReflect ¶ added in v0.10.1
func (x *CommercialPaperList) ProtoReflect() protoreflect.Message
func (*CommercialPaperList) Reset ¶ added in v0.10.1
func (x *CommercialPaperList) Reset()
func (*CommercialPaperList) String ¶ added in v0.10.1
func (x *CommercialPaperList) String() string
func (*CommercialPaperList) Validate ¶ added in v0.10.1
func (this *CommercialPaperList) Validate() error
type CommercialPaper_State ¶ added in v0.10.1
type CommercialPaper_State int32
const ( CommercialPaper_STATE_ISSUED CommercialPaper_State = 0 CommercialPaper_STATE_TRADING CommercialPaper_State = 1 CommercialPaper_STATE_REDEEMED CommercialPaper_State = 2 )
func (CommercialPaper_State) Descriptor ¶ added in v0.10.1
func (CommercialPaper_State) Descriptor() protoreflect.EnumDescriptor
func (CommercialPaper_State) Enum ¶ added in v0.10.1
func (x CommercialPaper_State) Enum() *CommercialPaper_State
func (CommercialPaper_State) EnumDescriptor
deprecated
added in
v0.10.1
func (CommercialPaper_State) EnumDescriptor() ([]byte, []int)
Deprecated: Use CommercialPaper_State.Descriptor instead.
func (CommercialPaper_State) Number ¶ added in v0.10.1
func (x CommercialPaper_State) Number() protoreflect.EnumNumber
func (CommercialPaper_State) String ¶ added in v0.10.1
func (x CommercialPaper_State) String() string
func (CommercialPaper_State) Type ¶ added in v0.10.1
func (CommercialPaper_State) Type() protoreflect.EnumType
type ExternalId ¶ added in v0.10.1
type ExternalId struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
ExternalId
func (*ExternalId) Descriptor
deprecated
added in
v0.10.1
func (*ExternalId) Descriptor() ([]byte, []int)
Deprecated: Use ExternalId.ProtoReflect.Descriptor instead.
func (*ExternalId) GetId ¶ added in v0.10.1
func (x *ExternalId) GetId() string
func (*ExternalId) ProtoMessage ¶ added in v0.10.1
func (*ExternalId) ProtoMessage()
func (*ExternalId) ProtoReflect ¶ added in v0.10.1
func (x *ExternalId) ProtoReflect() protoreflect.Message
func (*ExternalId) Reset ¶ added in v0.10.1
func (x *ExternalId) Reset()
func (*ExternalId) String ¶ added in v0.10.1
func (x *ExternalId) String() string
func (*ExternalId) Validate ¶ added in v0.10.1
func (this *ExternalId) Validate() error
type IssueCommercialPaper ¶ added in v0.10.1
type IssueCommercialPaper 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"` IssueDate *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=issue_date,json=issueDate,proto3" json:"issue_date,omitempty"` MaturityDate *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=maturity_date,json=maturityDate,proto3" json:"maturity_date,omitempty"` FaceValue int32 `protobuf:"varint,5,opt,name=face_value,json=faceValue,proto3" json:"face_value,omitempty"` // external_id - once more uniq id of state entry ExternalId string `protobuf:"bytes,6,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"` // contains filtered or unexported fields }
IssueCommercialPaper event
func (*IssueCommercialPaper) Descriptor
deprecated
added in
v0.10.1
func (*IssueCommercialPaper) Descriptor() ([]byte, []int)
Deprecated: Use IssueCommercialPaper.ProtoReflect.Descriptor instead.
func (*IssueCommercialPaper) GetExternalId ¶ added in v0.10.1
func (x *IssueCommercialPaper) GetExternalId() string
func (*IssueCommercialPaper) GetFaceValue ¶ added in v0.10.1
func (x *IssueCommercialPaper) GetFaceValue() int32
func (*IssueCommercialPaper) GetIssueDate ¶ added in v0.10.1
func (x *IssueCommercialPaper) GetIssueDate() *timestamppb.Timestamp
func (*IssueCommercialPaper) GetIssuer ¶ added in v0.10.1
func (x *IssueCommercialPaper) GetIssuer() string
func (*IssueCommercialPaper) GetMaturityDate ¶ added in v0.10.1
func (x *IssueCommercialPaper) GetMaturityDate() *timestamppb.Timestamp
func (*IssueCommercialPaper) GetPaperNumber ¶ added in v0.10.1
func (x *IssueCommercialPaper) GetPaperNumber() string
func (*IssueCommercialPaper) ProtoMessage ¶ added in v0.10.1
func (*IssueCommercialPaper) ProtoMessage()
func (*IssueCommercialPaper) ProtoReflect ¶ added in v0.10.1
func (x *IssueCommercialPaper) ProtoReflect() protoreflect.Message
func (*IssueCommercialPaper) Reset ¶ added in v0.10.1
func (x *IssueCommercialPaper) Reset()
func (*IssueCommercialPaper) String ¶ added in v0.10.1
func (x *IssueCommercialPaper) String() string
func (*IssueCommercialPaper) Validate ¶ added in v0.10.1
func (this *IssueCommercialPaper) Validate() error
type RedeemCommercialPaper ¶ added in v0.10.1
type RedeemCommercialPaper 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"` RedeemingOwner string `protobuf:"bytes,3,opt,name=redeeming_owner,json=redeemingOwner,proto3" json:"redeeming_owner,omitempty"` RedeemDate *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=redeem_date,json=redeemDate,proto3" json:"redeem_date,omitempty"` // contains filtered or unexported fields }
RedeemCommercialPaper event
func (*RedeemCommercialPaper) Descriptor
deprecated
added in
v0.10.1
func (*RedeemCommercialPaper) Descriptor() ([]byte, []int)
Deprecated: Use RedeemCommercialPaper.ProtoReflect.Descriptor instead.
func (*RedeemCommercialPaper) GetIssuer ¶ added in v0.10.1
func (x *RedeemCommercialPaper) GetIssuer() string
func (*RedeemCommercialPaper) GetPaperNumber ¶ added in v0.10.1
func (x *RedeemCommercialPaper) GetPaperNumber() string
func (*RedeemCommercialPaper) GetRedeemDate ¶ added in v0.10.1
func (x *RedeemCommercialPaper) GetRedeemDate() *timestamppb.Timestamp
func (*RedeemCommercialPaper) GetRedeemingOwner ¶ added in v0.10.1
func (x *RedeemCommercialPaper) GetRedeemingOwner() string
func (*RedeemCommercialPaper) ProtoMessage ¶ added in v0.10.1
func (*RedeemCommercialPaper) ProtoMessage()
func (*RedeemCommercialPaper) ProtoReflect ¶ added in v0.10.1
func (x *RedeemCommercialPaper) ProtoReflect() protoreflect.Message
func (*RedeemCommercialPaper) Reset ¶ added in v0.10.1
func (x *RedeemCommercialPaper) Reset()
func (*RedeemCommercialPaper) String ¶ added in v0.10.1
func (x *RedeemCommercialPaper) String() string
func (*RedeemCommercialPaper) Validate ¶ added in v0.10.1
func (this *RedeemCommercialPaper) Validate() error
type UnimplementedCPaperServiceServer ¶ added in v0.10.1
type UnimplementedCPaperServiceServer struct { }
UnimplementedCPaperServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedCPaperServiceServer) Buy ¶ added in v0.10.1
func (*UnimplementedCPaperServiceServer) Buy(context.Context, *BuyCommercialPaper) (*CommercialPaper, error)
func (*UnimplementedCPaperServiceServer) Delete ¶ added in v0.10.1
func (*UnimplementedCPaperServiceServer) Delete(context.Context, *CommercialPaperId) (*CommercialPaper, error)
func (*UnimplementedCPaperServiceServer) Get ¶ added in v0.10.1
func (*UnimplementedCPaperServiceServer) Get(context.Context, *CommercialPaperId) (*CommercialPaper, error)
func (*UnimplementedCPaperServiceServer) GetByExternalId ¶ added in v0.10.1
func (*UnimplementedCPaperServiceServer) GetByExternalId(context.Context, *ExternalId) (*CommercialPaper, error)
func (*UnimplementedCPaperServiceServer) Issue ¶ added in v0.10.1
func (*UnimplementedCPaperServiceServer) Issue(context.Context, *IssueCommercialPaper) (*CommercialPaper, error)
func (*UnimplementedCPaperServiceServer) List ¶ added in v0.10.1
func (*UnimplementedCPaperServiceServer) List(context.Context, *emptypb.Empty) (*CommercialPaperList, error)
func (*UnimplementedCPaperServiceServer) Redeem ¶ added in v0.10.1
func (*UnimplementedCPaperServiceServer) Redeem(context.Context, *RedeemCommercialPaper) (*CommercialPaper, error)