Documentation ¶
Overview ¶
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client APIClient) error
- func RegisterAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server APIServer) error
- func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)
- type APIClient
- type APIServer
- type ErrorResponse
- type GeneralParams
- func (*GeneralParams) Descriptor() ([]byte, []int)deprecated
- func (x *GeneralParams) GetChaincode() string
- func (x *GeneralParams) GetChannel() string
- func (x *GeneralParams) GetMethodName() string
- func (x *GeneralParams) GetNonce() string
- func (x *GeneralParams) GetOptions() []*typepb.Option
- func (x *GeneralParams) GetPublicKey() string
- func (x *GeneralParams) GetRequestId() string
- func (x *GeneralParams) GetSign() string
- func (*GeneralParams) ProtoMessage()
- func (x *GeneralParams) ProtoReflect() protoreflect.Message
- func (x *GeneralParams) Reset()
- func (x *GeneralParams) String() string
- type TransferBeginAdminRequest
- func (*TransferBeginAdminRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TransferBeginAdminRequest) GetAddress() string
- func (x *TransferBeginAdminRequest) GetAmount() string
- func (x *TransferBeginAdminRequest) GetChannelTo() string
- func (x *TransferBeginAdminRequest) GetGenerals() *GeneralParams
- func (x *TransferBeginAdminRequest) GetIdTransfer() string
- func (x *TransferBeginAdminRequest) GetOptions() []*typepb.Option
- func (x *TransferBeginAdminRequest) GetToken() string
- func (*TransferBeginAdminRequest) ProtoMessage()
- func (x *TransferBeginAdminRequest) ProtoReflect() protoreflect.Message
- func (x *TransferBeginAdminRequest) Reset()
- func (x *TransferBeginAdminRequest) String() string
- type TransferBeginCustomerRequest
- func (*TransferBeginCustomerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TransferBeginCustomerRequest) GetAmount() string
- func (x *TransferBeginCustomerRequest) GetChannelTo() string
- func (x *TransferBeginCustomerRequest) GetGenerals() *GeneralParams
- func (x *TransferBeginCustomerRequest) GetIdTransfer() string
- func (x *TransferBeginCustomerRequest) GetOptions() []*typepb.Option
- func (x *TransferBeginCustomerRequest) GetToken() string
- func (*TransferBeginCustomerRequest) ProtoMessage()
- func (x *TransferBeginCustomerRequest) ProtoReflect() protoreflect.Message
- func (x *TransferBeginCustomerRequest) Reset()
- func (x *TransferBeginCustomerRequest) String() string
- type TransferStatusRequest
- func (*TransferStatusRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TransferStatusRequest) GetIdTransfer() string
- func (x *TransferStatusRequest) GetOptions() []*typepb.Option
- func (*TransferStatusRequest) ProtoMessage()
- func (x *TransferStatusRequest) ProtoReflect() protoreflect.Message
- func (x *TransferStatusRequest) Reset()
- func (x *TransferStatusRequest) String() string
- type TransferStatusResponse
- func (*TransferStatusResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TransferStatusResponse) GetIdTransfer() string
- func (x *TransferStatusResponse) GetMessage() string
- func (x *TransferStatusResponse) GetStatus() TransferStatusResponse_Status
- func (*TransferStatusResponse) ProtoMessage()
- func (x *TransferStatusResponse) ProtoReflect() protoreflect.Message
- func (x *TransferStatusResponse) Reset()
- func (x *TransferStatusResponse) String() string
- type TransferStatusResponse_Status
- func (TransferStatusResponse_Status) Descriptor() protoreflect.EnumDescriptor
- func (x TransferStatusResponse_Status) Enum() *TransferStatusResponse_Status
- func (TransferStatusResponse_Status) EnumDescriptor() ([]byte, []int)deprecated
- func (x TransferStatusResponse_Status) Number() protoreflect.EnumNumber
- func (x TransferStatusResponse_Status) String() string
- func (TransferStatusResponse_Status) Type() protoreflect.EnumType
- type UnimplementedAPIServer
- func (UnimplementedAPIServer) TransferByAdmin(context.Context, *TransferBeginAdminRequest) (*TransferStatusResponse, error)
- func (UnimplementedAPIServer) TransferByCustomer(context.Context, *TransferBeginCustomerRequest) (*TransferStatusResponse, error)
- func (UnimplementedAPIServer) TransferStatus(context.Context, *TransferStatusRequest) (*TransferStatusResponse, error)
- type UnsafeAPIServer
Constants ¶
const ( API_TransferByCustomer_FullMethodName = "/core.channel_transfer.API/TransferByCustomer" API_TransferByAdmin_FullMethodName = "/core.channel_transfer.API/TransferByAdmin" API_TransferStatus_FullMethodName = "/core.channel_transfer.API/TransferStatus" )
Variables ¶
var ( TransferStatusResponse_Status_name = map[int32]string{ 0: "STATUS_IN_PROCESS", 1: "STATUS_UNDEFINED", 2: "STATUS_COMPLETED", 3: "STATUS_CANCELED", 4: "STATUS_ERROR", } TransferStatusResponse_Status_value = map[string]int32{ "STATUS_IN_PROCESS": 0, "STATUS_UNDEFINED": 1, "STATUS_COMPLETED": 2, "STATUS_CANCELED": 3, "STATUS_ERROR": 4, } )
Enum value maps for TransferStatusResponse_Status.
var API_ServiceDesc = grpc.ServiceDesc{ ServiceName: "core.channel_transfer.API", HandlerType: (*APIServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "TransferByCustomer", Handler: _API_TransferByCustomer_Handler, }, { MethodName: "TransferByAdmin", Handler: _API_TransferByAdmin_Handler, }, { MethodName: "TransferStatus", Handler: _API_TransferStatus_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "service.proto", }
API_ServiceDesc is the grpc.ServiceDesc for API service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_service_proto protoreflect.FileDescriptor
var SwaggerJSON []byte
Functions ¶
func RegisterAPIHandler ¶
RegisterAPIHandler registers the http handlers for service API to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAPIHandlerClient ¶
RegisterAPIHandlerClient registers the http handlers for service API to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "APIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "APIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "APIClient" to call the correct interceptors.
func RegisterAPIHandlerFromEndpoint ¶
func RegisterAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAPIHandlerFromEndpoint is same as RegisterAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAPIHandlerServer ¶
RegisterAPIHandlerServer registers the http handlers for service API to "mux". UnaryRPC :call APIServer 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 RegisterAPIHandlerFromEndpoint instead.
func RegisterAPIServer ¶
func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)
Types ¶
type APIClient ¶
type APIClient interface { TransferByCustomer(ctx context.Context, in *TransferBeginCustomerRequest, opts ...grpc.CallOption) (*TransferStatusResponse, error) TransferByAdmin(ctx context.Context, in *TransferBeginAdminRequest, opts ...grpc.CallOption) (*TransferStatusResponse, error) TransferStatus(ctx context.Context, in *TransferStatusRequest, opts ...grpc.CallOption) (*TransferStatusResponse, error) }
APIClient is the client API for API service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewAPIClient ¶
func NewAPIClient(cc grpc.ClientConnInterface) APIClient
type APIServer ¶
type APIServer interface { TransferByCustomer(context.Context, *TransferBeginCustomerRequest) (*TransferStatusResponse, error) TransferByAdmin(context.Context, *TransferBeginAdminRequest) (*TransferStatusResponse, error) TransferStatus(context.Context, *TransferStatusRequest) (*TransferStatusResponse, error) // contains filtered or unexported methods }
APIServer is the server API for API service. All implementations must embed UnimplementedAPIServer for forward compatibility
type ErrorResponse ¶
type ErrorResponse struct { Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` // error message // contains filtered or unexported fields }
ErrorResponse response with an error
func (*ErrorResponse) Descriptor
deprecated
func (*ErrorResponse) Descriptor() ([]byte, []int)
Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.
func (*ErrorResponse) GetError ¶
func (x *ErrorResponse) GetError() string
func (*ErrorResponse) ProtoMessage ¶
func (*ErrorResponse) ProtoMessage()
func (*ErrorResponse) ProtoReflect ¶
func (x *ErrorResponse) ProtoReflect() protoreflect.Message
func (*ErrorResponse) Reset ¶
func (x *ErrorResponse) Reset()
func (*ErrorResponse) String ¶
func (x *ErrorResponse) String() string
type GeneralParams ¶
type GeneralParams struct { MethodName string `protobuf:"bytes,1,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` // method name RequestId string `protobuf:"bytes,2,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // request ID (may be empty) Chaincode string `protobuf:"bytes,3,opt,name=chaincode,proto3" json:"chaincode,omitempty"` // chaincode name Channel string `protobuf:"bytes,4,opt,name=channel,proto3" json:"channel,omitempty"` // channel name Nonce string `protobuf:"bytes,5,opt,name=nonce,proto3" json:"nonce,omitempty"` // request nonce PublicKey string `protobuf:"bytes,6,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // public key of user, signed the request Sign string `protobuf:"bytes,7,opt,name=sign,proto3" json:"sign,omitempty"` // request sign Options []*typepb.Option `protobuf:"bytes,8,rep,name=options,proto3" json:"options,omitempty"` // contains filtered or unexported fields }
GeneralParams general parameters for every request
func (*GeneralParams) Descriptor
deprecated
func (*GeneralParams) Descriptor() ([]byte, []int)
Deprecated: Use GeneralParams.ProtoReflect.Descriptor instead.
func (*GeneralParams) GetChaincode ¶
func (x *GeneralParams) GetChaincode() string
func (*GeneralParams) GetChannel ¶
func (x *GeneralParams) GetChannel() string
func (*GeneralParams) GetMethodName ¶
func (x *GeneralParams) GetMethodName() string
func (*GeneralParams) GetNonce ¶
func (x *GeneralParams) GetNonce() string
func (*GeneralParams) GetOptions ¶
func (x *GeneralParams) GetOptions() []*typepb.Option
func (*GeneralParams) GetPublicKey ¶
func (x *GeneralParams) GetPublicKey() string
func (*GeneralParams) GetRequestId ¶
func (x *GeneralParams) GetRequestId() string
func (*GeneralParams) GetSign ¶
func (x *GeneralParams) GetSign() string
func (*GeneralParams) ProtoMessage ¶
func (*GeneralParams) ProtoMessage()
func (*GeneralParams) ProtoReflect ¶
func (x *GeneralParams) ProtoReflect() protoreflect.Message
func (*GeneralParams) Reset ¶
func (x *GeneralParams) Reset()
func (*GeneralParams) String ¶
func (x *GeneralParams) String() string
type TransferBeginAdminRequest ¶
type TransferBeginAdminRequest struct { Generals *GeneralParams `protobuf:"bytes,1,opt,name=generals,proto3" json:"generals,omitempty"` // general parameters IdTransfer string `protobuf:"bytes,2,opt,name=id_transfer,json=idTransfer,proto3" json:"id_transfer,omitempty"` // transfer ID (should be unique) ChannelTo string `protobuf:"bytes,3,opt,name=channel_to,json=channelTo,proto3" json:"channel_to,omitempty"` // destination channel Address string `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` // token's owner address Token string `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"` // tokens to transfer Amount string `protobuf:"bytes,6,opt,name=amount,proto3" json:"amount,omitempty"` // amount of tokens to transfer Options []*typepb.Option `protobuf:"bytes,7,rep,name=options,proto3" json:"options,omitempty"` // contains filtered or unexported fields }
TransferBeginAdminRequest request for tokens transfer by platform administrator
func (*TransferBeginAdminRequest) Descriptor
deprecated
func (*TransferBeginAdminRequest) Descriptor() ([]byte, []int)
Deprecated: Use TransferBeginAdminRequest.ProtoReflect.Descriptor instead.
func (*TransferBeginAdminRequest) GetAddress ¶
func (x *TransferBeginAdminRequest) GetAddress() string
func (*TransferBeginAdminRequest) GetAmount ¶
func (x *TransferBeginAdminRequest) GetAmount() string
func (*TransferBeginAdminRequest) GetChannelTo ¶
func (x *TransferBeginAdminRequest) GetChannelTo() string
func (*TransferBeginAdminRequest) GetGenerals ¶
func (x *TransferBeginAdminRequest) GetGenerals() *GeneralParams
func (*TransferBeginAdminRequest) GetIdTransfer ¶
func (x *TransferBeginAdminRequest) GetIdTransfer() string
func (*TransferBeginAdminRequest) GetOptions ¶
func (x *TransferBeginAdminRequest) GetOptions() []*typepb.Option
func (*TransferBeginAdminRequest) GetToken ¶
func (x *TransferBeginAdminRequest) GetToken() string
func (*TransferBeginAdminRequest) ProtoMessage ¶
func (*TransferBeginAdminRequest) ProtoMessage()
func (*TransferBeginAdminRequest) ProtoReflect ¶
func (x *TransferBeginAdminRequest) ProtoReflect() protoreflect.Message
func (*TransferBeginAdminRequest) Reset ¶
func (x *TransferBeginAdminRequest) Reset()
func (*TransferBeginAdminRequest) String ¶
func (x *TransferBeginAdminRequest) String() string
type TransferBeginCustomerRequest ¶
type TransferBeginCustomerRequest struct { Generals *GeneralParams `protobuf:"bytes,1,opt,name=generals,proto3" json:"generals,omitempty"` // general parameters IdTransfer string `protobuf:"bytes,2,opt,name=id_transfer,json=idTransfer,proto3" json:"id_transfer,omitempty"` // transfer ID (should be unique) ChannelTo string `protobuf:"bytes,3,opt,name=channel_to,json=channelTo,proto3" json:"channel_to,omitempty"` // destination channel Token string `protobuf:"bytes,4,opt,name=token,proto3" json:"token,omitempty"` // Tokens to transfer Amount string `protobuf:"bytes,5,opt,name=amount,proto3" json:"amount,omitempty"` // Amount of tokens to transfer Options []*typepb.Option `protobuf:"bytes,6,rep,name=options,proto3" json:"options,omitempty"` // contains filtered or unexported fields }
TransferBeginAdminRequest request for tokens transfer by tokens owner
func (*TransferBeginCustomerRequest) Descriptor
deprecated
func (*TransferBeginCustomerRequest) Descriptor() ([]byte, []int)
Deprecated: Use TransferBeginCustomerRequest.ProtoReflect.Descriptor instead.
func (*TransferBeginCustomerRequest) GetAmount ¶
func (x *TransferBeginCustomerRequest) GetAmount() string
func (*TransferBeginCustomerRequest) GetChannelTo ¶
func (x *TransferBeginCustomerRequest) GetChannelTo() string
func (*TransferBeginCustomerRequest) GetGenerals ¶
func (x *TransferBeginCustomerRequest) GetGenerals() *GeneralParams
func (*TransferBeginCustomerRequest) GetIdTransfer ¶
func (x *TransferBeginCustomerRequest) GetIdTransfer() string
func (*TransferBeginCustomerRequest) GetOptions ¶
func (x *TransferBeginCustomerRequest) GetOptions() []*typepb.Option
func (*TransferBeginCustomerRequest) GetToken ¶
func (x *TransferBeginCustomerRequest) GetToken() string
func (*TransferBeginCustomerRequest) ProtoMessage ¶
func (*TransferBeginCustomerRequest) ProtoMessage()
func (*TransferBeginCustomerRequest) ProtoReflect ¶
func (x *TransferBeginCustomerRequest) ProtoReflect() protoreflect.Message
func (*TransferBeginCustomerRequest) Reset ¶
func (x *TransferBeginCustomerRequest) Reset()
func (*TransferBeginCustomerRequest) String ¶
func (x *TransferBeginCustomerRequest) String() string
type TransferStatusRequest ¶
type TransferStatusRequest struct { IdTransfer string `protobuf:"bytes,1,opt,name=id_transfer,json=idTransfer,proto3" json:"id_transfer,omitempty"` // transfer ID Options []*typepb.Option `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"` // contains filtered or unexported fields }
TransferStatusRequest request for transfer status
func (*TransferStatusRequest) Descriptor
deprecated
func (*TransferStatusRequest) Descriptor() ([]byte, []int)
Deprecated: Use TransferStatusRequest.ProtoReflect.Descriptor instead.
func (*TransferStatusRequest) GetIdTransfer ¶
func (x *TransferStatusRequest) GetIdTransfer() string
func (*TransferStatusRequest) GetOptions ¶
func (x *TransferStatusRequest) GetOptions() []*typepb.Option
func (*TransferStatusRequest) ProtoMessage ¶
func (*TransferStatusRequest) ProtoMessage()
func (*TransferStatusRequest) ProtoReflect ¶
func (x *TransferStatusRequest) ProtoReflect() protoreflect.Message
func (*TransferStatusRequest) Reset ¶
func (x *TransferStatusRequest) Reset()
func (*TransferStatusRequest) String ¶
func (x *TransferStatusRequest) String() string
type TransferStatusResponse ¶
type TransferStatusResponse struct { IdTransfer string `protobuf:"bytes,1,opt,name=id_transfer,json=idTransfer,proto3" json:"id_transfer,omitempty"` // transfer ID Status TransferStatusResponse_Status `protobuf:"varint,2,opt,name=status,proto3,enum=core.channel_transfer.TransferStatusResponse_Status" json:"status,omitempty"` // transfer status Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // error message (may be empty) // contains filtered or unexported fields }
TransferStatusResponse response for TransferStatus transaction
func (*TransferStatusResponse) Descriptor
deprecated
func (*TransferStatusResponse) Descriptor() ([]byte, []int)
Deprecated: Use TransferStatusResponse.ProtoReflect.Descriptor instead.
func (*TransferStatusResponse) GetIdTransfer ¶
func (x *TransferStatusResponse) GetIdTransfer() string
func (*TransferStatusResponse) GetMessage ¶
func (x *TransferStatusResponse) GetMessage() string
func (*TransferStatusResponse) GetStatus ¶
func (x *TransferStatusResponse) GetStatus() TransferStatusResponse_Status
func (*TransferStatusResponse) ProtoMessage ¶
func (*TransferStatusResponse) ProtoMessage()
func (*TransferStatusResponse) ProtoReflect ¶
func (x *TransferStatusResponse) ProtoReflect() protoreflect.Message
func (*TransferStatusResponse) Reset ¶
func (x *TransferStatusResponse) Reset()
func (*TransferStatusResponse) String ¶
func (x *TransferStatusResponse) String() string
type TransferStatusResponse_Status ¶
type TransferStatusResponse_Status int32
const ( TransferStatusResponse_STATUS_IN_PROCESS TransferStatusResponse_Status = 0 TransferStatusResponse_STATUS_UNDEFINED TransferStatusResponse_Status = 1 TransferStatusResponse_STATUS_COMPLETED TransferStatusResponse_Status = 2 TransferStatusResponse_STATUS_CANCELED TransferStatusResponse_Status = 3 TransferStatusResponse_STATUS_ERROR TransferStatusResponse_Status = 4 )
func (TransferStatusResponse_Status) Descriptor ¶
func (TransferStatusResponse_Status) Descriptor() protoreflect.EnumDescriptor
func (TransferStatusResponse_Status) Enum ¶
func (x TransferStatusResponse_Status) Enum() *TransferStatusResponse_Status
func (TransferStatusResponse_Status) EnumDescriptor
deprecated
func (TransferStatusResponse_Status) EnumDescriptor() ([]byte, []int)
Deprecated: Use TransferStatusResponse_Status.Descriptor instead.
func (TransferStatusResponse_Status) Number ¶
func (x TransferStatusResponse_Status) Number() protoreflect.EnumNumber
func (TransferStatusResponse_Status) String ¶
func (x TransferStatusResponse_Status) String() string
func (TransferStatusResponse_Status) Type ¶
func (TransferStatusResponse_Status) Type() protoreflect.EnumType
type UnimplementedAPIServer ¶
type UnimplementedAPIServer struct { }
UnimplementedAPIServer must be embedded to have forward compatible implementations.
func (UnimplementedAPIServer) TransferByAdmin ¶
func (UnimplementedAPIServer) TransferByAdmin(context.Context, *TransferBeginAdminRequest) (*TransferStatusResponse, error)
func (UnimplementedAPIServer) TransferByCustomer ¶
func (UnimplementedAPIServer) TransferByCustomer(context.Context, *TransferBeginCustomerRequest) (*TransferStatusResponse, error)
func (UnimplementedAPIServer) TransferStatus ¶
func (UnimplementedAPIServer) TransferStatus(context.Context, *TransferStatusRequest) (*TransferStatusResponse, error)
type UnsafeAPIServer ¶
type UnsafeAPIServer interface {
// contains filtered or unexported methods
}
UnsafeAPIServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to APIServer will result in compilation errors.