Documentation ¶
Overview ¶
Package transactionPb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterTransactionServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTransactionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TransactionServiceClient) error
- func RegisterTransactionServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTransactionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TransactionServiceServer) error
- func RegisterTransactionServiceServer(s grpc.ServiceRegistrar, srv TransactionServiceServer)
- type General
- type GeneralFilter
- func (*GeneralFilter) Descriptor() ([]byte, []int)deprecated
- func (x *GeneralFilter) GetLimit() uint32
- func (x *GeneralFilter) GetOffset() uint32
- func (x *GeneralFilter) GetOrderBy() string
- func (x *GeneralFilter) GetQ() string
- func (*GeneralFilter) ProtoMessage()
- func (x *GeneralFilter) ProtoReflect() protoreflect.Message
- func (x *GeneralFilter) Reset()
- func (x *GeneralFilter) String() string
- type GeneralIdRequest
- type GeneralResponse
- type Transaction
- func (*Transaction) Descriptor() ([]byte, []int)deprecated
- func (x *Transaction) GetDescription() string
- func (x *Transaction) GetId() string
- func (x *Transaction) GetIdName() string
- func (x *Transaction) GetName() string
- func (x *Transaction) GetReturn() *wrapperspb.BoolValue
- func (x *Transaction) GetSalesDate() *timestamppb.Timestamp
- func (x *Transaction) GetUnit() uint32
- func (*Transaction) ProtoMessage()
- func (x *Transaction) ProtoReflect() protoreflect.Message
- func (x *Transaction) Reset()
- func (x *Transaction) String() string
- type TransactionList
- type TransactionServiceClient
- type TransactionServiceServer
- type UnimplementedTransactionServiceServer
- func (UnimplementedTransactionServiceServer) CreateTransaction(context.Context, *Transaction) (*GeneralResponse, error)
- func (UnimplementedTransactionServiceServer) DeleteTransaction(context.Context, *GeneralIdRequest) (*GeneralResponse, error)
- func (UnimplementedTransactionServiceServer) GetListTransaction(context.Context, *GeneralFilter) (*TransactionList, error)
- func (UnimplementedTransactionServiceServer) GetTransaction(context.Context, *GeneralIdRequest) (*Transaction, error)
- func (UnimplementedTransactionServiceServer) UpdateTransaction(context.Context, *Transaction) (*GeneralResponse, error)
- type UnsafeTransactionServiceServer
Constants ¶
const ( TransactionService_CreateTransaction_FullMethodName = "/transactionPb.TransactionService/CreateTransaction" TransactionService_DeleteTransaction_FullMethodName = "/transactionPb.TransactionService/DeleteTransaction" TransactionService_GetListTransaction_FullMethodName = "/transactionPb.TransactionService/GetListTransaction" TransactionService_GetTransaction_FullMethodName = "/transactionPb.TransactionService/GetTransaction" TransactionService_UpdateTransaction_FullMethodName = "/transactionPb.TransactionService/UpdateTransaction" )
Variables ¶
var File_transaction_transaction_proto protoreflect.FileDescriptor
var TransactionService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "transactionPb.TransactionService", HandlerType: (*TransactionServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateTransaction", Handler: _TransactionService_CreateTransaction_Handler, }, { MethodName: "DeleteTransaction", Handler: _TransactionService_DeleteTransaction_Handler, }, { MethodName: "GetListTransaction", Handler: _TransactionService_GetListTransaction_Handler, }, { MethodName: "GetTransaction", Handler: _TransactionService_GetTransaction_Handler, }, { MethodName: "UpdateTransaction", Handler: _TransactionService_UpdateTransaction_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "transaction/transaction.proto", }
TransactionService_ServiceDesc is the grpc.ServiceDesc for TransactionService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTransactionServiceHandler ¶
func RegisterTransactionServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTransactionServiceHandler registers the http handlers for service TransactionService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTransactionServiceHandlerClient ¶
func RegisterTransactionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TransactionServiceClient) error
RegisterTransactionServiceHandlerClient registers the http handlers for service TransactionService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TransactionServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TransactionServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TransactionServiceClient" to call the correct interceptors.
func RegisterTransactionServiceHandlerFromEndpoint ¶
func RegisterTransactionServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTransactionServiceHandlerFromEndpoint is same as RegisterTransactionServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTransactionServiceHandlerServer ¶
func RegisterTransactionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TransactionServiceServer) error
RegisterTransactionServiceHandlerServer registers the http handlers for service TransactionService to "mux". UnaryRPC :call TransactionServiceServer 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 RegisterTransactionServiceHandlerFromEndpoint instead.
func RegisterTransactionServiceServer ¶
func RegisterTransactionServiceServer(s grpc.ServiceRegistrar, srv TransactionServiceServer)
Types ¶
type General ¶
type General struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*General) Descriptor
deprecated
func (*General) GetMessage ¶
func (*General) ProtoMessage ¶
func (*General) ProtoMessage()
func (*General) ProtoReflect ¶
func (x *General) ProtoReflect() protoreflect.Message
type GeneralFilter ¶
type GeneralFilter struct { Q string `protobuf:"bytes,1,opt,name=q,proto3" json:"q,omitempty"` OrderBy string `protobuf:"bytes,2,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"` Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` Offset uint32 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` // contains filtered or unexported fields }
func (*GeneralFilter) Descriptor
deprecated
func (*GeneralFilter) Descriptor() ([]byte, []int)
Deprecated: Use GeneralFilter.ProtoReflect.Descriptor instead.
func (*GeneralFilter) GetLimit ¶
func (x *GeneralFilter) GetLimit() uint32
func (*GeneralFilter) GetOffset ¶
func (x *GeneralFilter) GetOffset() uint32
func (*GeneralFilter) GetOrderBy ¶
func (x *GeneralFilter) GetOrderBy() string
func (*GeneralFilter) GetQ ¶
func (x *GeneralFilter) GetQ() string
func (*GeneralFilter) ProtoMessage ¶
func (*GeneralFilter) ProtoMessage()
func (*GeneralFilter) ProtoReflect ¶
func (x *GeneralFilter) ProtoReflect() protoreflect.Message
func (*GeneralFilter) Reset ¶
func (x *GeneralFilter) Reset()
func (*GeneralFilter) String ¶
func (x *GeneralFilter) String() string
type GeneralIdRequest ¶
type GeneralIdRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GeneralIdRequest) Descriptor
deprecated
func (*GeneralIdRequest) Descriptor() ([]byte, []int)
Deprecated: Use GeneralIdRequest.ProtoReflect.Descriptor instead.
func (*GeneralIdRequest) GetId ¶
func (x *GeneralIdRequest) GetId() string
func (*GeneralIdRequest) ProtoMessage ¶
func (*GeneralIdRequest) ProtoMessage()
func (*GeneralIdRequest) ProtoReflect ¶
func (x *GeneralIdRequest) ProtoReflect() protoreflect.Message
func (*GeneralIdRequest) Reset ¶
func (x *GeneralIdRequest) Reset()
func (*GeneralIdRequest) String ¶
func (x *GeneralIdRequest) String() string
type GeneralResponse ¶
type GeneralResponse struct { Data *General `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*GeneralResponse) Descriptor
deprecated
func (*GeneralResponse) Descriptor() ([]byte, []int)
Deprecated: Use GeneralResponse.ProtoReflect.Descriptor instead.
func (*GeneralResponse) GetData ¶
func (x *GeneralResponse) GetData() *General
func (*GeneralResponse) ProtoMessage ¶
func (*GeneralResponse) ProtoMessage()
func (*GeneralResponse) ProtoReflect ¶
func (x *GeneralResponse) ProtoReflect() protoreflect.Message
func (*GeneralResponse) Reset ¶
func (x *GeneralResponse) Reset()
func (*GeneralResponse) String ¶
func (x *GeneralResponse) String() string
type Transaction ¶
type Transaction struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` IdName string `protobuf:"bytes,2,opt,name=id_name,json=idName,proto3" json:"id_name,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Return *wrapperspb.BoolValue `protobuf:"bytes,4,opt,name=return,proto3" json:"return,omitempty"` SalesDate *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=sales_date,json=salesDate,proto3" json:"sales_date,omitempty"` Unit uint32 `protobuf:"varint,6,opt,name=unit,proto3" json:"unit,omitempty"` Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
func (*Transaction) Descriptor
deprecated
func (*Transaction) Descriptor() ([]byte, []int)
Deprecated: Use Transaction.ProtoReflect.Descriptor instead.
func (*Transaction) GetDescription ¶
func (x *Transaction) GetDescription() string
func (*Transaction) GetId ¶
func (x *Transaction) GetId() string
func (*Transaction) GetIdName ¶
func (x *Transaction) GetIdName() string
func (*Transaction) GetName ¶
func (x *Transaction) GetName() string
func (*Transaction) GetReturn ¶
func (x *Transaction) GetReturn() *wrapperspb.BoolValue
func (*Transaction) GetSalesDate ¶
func (x *Transaction) GetSalesDate() *timestamppb.Timestamp
func (*Transaction) GetUnit ¶
func (x *Transaction) GetUnit() uint32
func (*Transaction) ProtoMessage ¶
func (*Transaction) ProtoMessage()
func (*Transaction) ProtoReflect ¶
func (x *Transaction) ProtoReflect() protoreflect.Message
func (*Transaction) Reset ¶
func (x *Transaction) Reset()
func (*Transaction) String ¶
func (x *Transaction) String() string
type TransactionList ¶
type TransactionList struct { Data []*Transaction `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*TransactionList) Descriptor
deprecated
func (*TransactionList) Descriptor() ([]byte, []int)
Deprecated: Use TransactionList.ProtoReflect.Descriptor instead.
func (*TransactionList) GetData ¶
func (x *TransactionList) GetData() []*Transaction
func (*TransactionList) ProtoMessage ¶
func (*TransactionList) ProtoMessage()
func (*TransactionList) ProtoReflect ¶
func (x *TransactionList) ProtoReflect() protoreflect.Message
func (*TransactionList) Reset ¶
func (x *TransactionList) Reset()
func (*TransactionList) String ¶
func (x *TransactionList) String() string
type TransactionServiceClient ¶
type TransactionServiceClient interface { CreateTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*GeneralResponse, error) DeleteTransaction(ctx context.Context, in *GeneralIdRequest, opts ...grpc.CallOption) (*GeneralResponse, error) GetListTransaction(ctx context.Context, in *GeneralFilter, opts ...grpc.CallOption) (*TransactionList, error) GetTransaction(ctx context.Context, in *GeneralIdRequest, opts ...grpc.CallOption) (*Transaction, error) UpdateTransaction(ctx context.Context, in *Transaction, opts ...grpc.CallOption) (*GeneralResponse, error) }
TransactionServiceClient is the client API for TransactionService 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 NewTransactionServiceClient ¶
func NewTransactionServiceClient(cc grpc.ClientConnInterface) TransactionServiceClient
type TransactionServiceServer ¶
type TransactionServiceServer interface { CreateTransaction(context.Context, *Transaction) (*GeneralResponse, error) DeleteTransaction(context.Context, *GeneralIdRequest) (*GeneralResponse, error) GetListTransaction(context.Context, *GeneralFilter) (*TransactionList, error) GetTransaction(context.Context, *GeneralIdRequest) (*Transaction, error) UpdateTransaction(context.Context, *Transaction) (*GeneralResponse, error) }
TransactionServiceServer is the server API for TransactionService service. All implementations should embed UnimplementedTransactionServiceServer for forward compatibility
type UnimplementedTransactionServiceServer ¶
type UnimplementedTransactionServiceServer struct { }
UnimplementedTransactionServiceServer should be embedded to have forward compatible implementations.
func (UnimplementedTransactionServiceServer) CreateTransaction ¶
func (UnimplementedTransactionServiceServer) CreateTransaction(context.Context, *Transaction) (*GeneralResponse, error)
func (UnimplementedTransactionServiceServer) DeleteTransaction ¶
func (UnimplementedTransactionServiceServer) DeleteTransaction(context.Context, *GeneralIdRequest) (*GeneralResponse, error)
func (UnimplementedTransactionServiceServer) GetListTransaction ¶
func (UnimplementedTransactionServiceServer) GetListTransaction(context.Context, *GeneralFilter) (*TransactionList, error)
func (UnimplementedTransactionServiceServer) GetTransaction ¶
func (UnimplementedTransactionServiceServer) GetTransaction(context.Context, *GeneralIdRequest) (*Transaction, error)
func (UnimplementedTransactionServiceServer) UpdateTransaction ¶
func (UnimplementedTransactionServiceServer) UpdateTransaction(context.Context, *Transaction) (*GeneralResponse, error)
type UnsafeTransactionServiceServer ¶
type UnsafeTransactionServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTransactionServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TransactionServiceServer will result in compilation errors.