Documentation ¶
Overview ¶
Package split_the_billv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterSplitTheBillServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSplitTheBillServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SplitTheBillServiceClient) error
- func RegisterSplitTheBillServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSplitTheBillServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SplitTheBillServiceServer) error
- func RegisterSplitTheBillServiceServer(s grpc.ServiceRegistrar, srv SplitTheBillServiceServer)
- type BillItem
- func (*BillItem) Descriptor() ([]byte, []int)deprecated
- func (x *BillItem) GetPricePerOne() *money.Money
- func (x *BillItem) GetQuantity() *decimal.Decimal
- func (x *BillItem) GetShares() []*BillShare
- func (x *BillItem) GetTitle() string
- func (x *BillItem) GetType() int64
- func (m *BillItem) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *BillItem) MarshalToVT(dAtA []byte) (int, error)
- func (m *BillItem) MarshalVT() (dAtA []byte, err error)
- func (*BillItem) ProtoMessage()
- func (x *BillItem) ProtoReflect() protoreflect.Message
- func (x *BillItem) Reset()
- func (m *BillItem) SizeVT() (n int)
- func (x *BillItem) String() string
- func (m *BillItem) UnmarshalVT(dAtA []byte) error
- type BillPayment
- func (*BillPayment) Descriptor() ([]byte, []int)deprecated
- func (x *BillPayment) GetAmount() int64
- func (x *BillPayment) GetUserId() int64
- func (m *BillPayment) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *BillPayment) MarshalToVT(dAtA []byte) (int, error)
- func (m *BillPayment) MarshalVT() (dAtA []byte, err error)
- func (*BillPayment) ProtoMessage()
- func (x *BillPayment) ProtoReflect() protoreflect.Message
- func (x *BillPayment) Reset()
- func (m *BillPayment) SizeVT() (n int)
- func (x *BillPayment) String() string
- func (m *BillPayment) UnmarshalVT(dAtA []byte) error
- type BillShare
- func (*BillShare) Descriptor() ([]byte, []int)deprecated
- func (x *BillShare) GetShare() uint64
- func (x *BillShare) GetUserId() int64
- func (m *BillShare) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *BillShare) MarshalToVT(dAtA []byte) (int, error)
- func (m *BillShare) MarshalVT() (dAtA []byte, err error)
- func (*BillShare) ProtoMessage()
- func (x *BillShare) ProtoReflect() protoreflect.Message
- func (x *BillShare) Reset()
- func (m *BillShare) SizeVT() (n int)
- func (x *BillShare) String() string
- func (m *BillShare) UnmarshalVT(dAtA []byte) error
- type NewBillRequest
- func (*NewBillRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NewBillRequest) GetItems() []*BillItem
- func (x *NewBillRequest) GetPayments() []*BillPayment
- func (m *NewBillRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *NewBillRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *NewBillRequest) MarshalVT() (dAtA []byte, err error)
- func (*NewBillRequest) ProtoMessage()
- func (x *NewBillRequest) ProtoReflect() protoreflect.Message
- func (x *NewBillRequest) Reset()
- func (m *NewBillRequest) SizeVT() (n int)
- func (x *NewBillRequest) String() string
- func (m *NewBillRequest) UnmarshalVT(dAtA []byte) error
- type NewBillResponse
- func (*NewBillResponse) Descriptor() ([]byte, []int)deprecated
- func (x *NewBillResponse) GetBillId() uint64
- func (m *NewBillResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *NewBillResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *NewBillResponse) MarshalVT() (dAtA []byte, err error)
- func (*NewBillResponse) ProtoMessage()
- func (x *NewBillResponse) ProtoReflect() protoreflect.Message
- func (x *NewBillResponse) Reset()
- func (m *NewBillResponse) SizeVT() (n int)
- func (x *NewBillResponse) String() string
- func (m *NewBillResponse) UnmarshalVT(dAtA []byte) error
- type SplitTheBillServiceClient
- type SplitTheBillServiceServer
- type UnimplementedSplitTheBillServiceServer
- type UnsafeSplitTheBillServiceServer
Constants ¶
const (
SplitTheBillService_NewBill_FullMethodName = "/dolgovnya.split_the_bill.v1.SplitTheBillService/NewBill"
)
Variables ¶
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
var File_dolgovnya_split_the_bill_v1_split_the_bill_proto protoreflect.FileDescriptor
var SplitTheBillService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "dolgovnya.split_the_bill.v1.SplitTheBillService", HandlerType: (*SplitTheBillServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "NewBill", Handler: _SplitTheBillService_NewBill_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "dolgovnya/split_the_bill/v1/split_the_bill.proto", }
SplitTheBillService_ServiceDesc is the grpc.ServiceDesc for SplitTheBillService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSplitTheBillServiceHandler ¶
func RegisterSplitTheBillServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSplitTheBillServiceHandler registers the http handlers for service SplitTheBillService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSplitTheBillServiceHandlerClient ¶
func RegisterSplitTheBillServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SplitTheBillServiceClient) error
RegisterSplitTheBillServiceHandlerClient registers the http handlers for service SplitTheBillService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SplitTheBillServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SplitTheBillServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SplitTheBillServiceClient" to call the correct interceptors.
func RegisterSplitTheBillServiceHandlerFromEndpoint ¶
func RegisterSplitTheBillServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSplitTheBillServiceHandlerFromEndpoint is same as RegisterSplitTheBillServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSplitTheBillServiceHandlerServer ¶
func RegisterSplitTheBillServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SplitTheBillServiceServer) error
RegisterSplitTheBillServiceHandlerServer registers the http handlers for service SplitTheBillService to "mux". UnaryRPC :call SplitTheBillServiceServer 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 RegisterSplitTheBillServiceHandlerFromEndpoint instead.
func RegisterSplitTheBillServiceServer ¶
func RegisterSplitTheBillServiceServer(s grpc.ServiceRegistrar, srv SplitTheBillServiceServer)
Types ¶
type BillItem ¶
type BillItem struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` PricePerOne *money.Money `protobuf:"bytes,2,opt,name=price_per_one,json=pricePerOne,proto3" json:"price_per_one,omitempty"` Quantity *decimal.Decimal `protobuf:"bytes,3,opt,name=quantity,proto3" json:"quantity,omitempty"` Type int64 `protobuf:"varint,4,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*BillItem) Descriptor
deprecated
func (*BillItem) GetPricePerOne ¶
func (*BillItem) GetQuantity ¶
func (*BillItem) MarshalToSizedBufferVT ¶
func (*BillItem) ProtoMessage ¶
func (*BillItem) ProtoMessage()
func (*BillItem) ProtoReflect ¶
func (x *BillItem) ProtoReflect() protoreflect.Message
func (*BillItem) UnmarshalVT ¶
type BillPayment ¶
type BillPayment struct { UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` // contains filtered or unexported fields }
func (*BillPayment) Descriptor
deprecated
func (*BillPayment) Descriptor() ([]byte, []int)
Deprecated: Use BillPayment.ProtoReflect.Descriptor instead.
func (*BillPayment) GetAmount ¶
func (x *BillPayment) GetAmount() int64
func (*BillPayment) GetUserId ¶
func (x *BillPayment) GetUserId() int64
func (*BillPayment) MarshalToSizedBufferVT ¶
func (m *BillPayment) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*BillPayment) MarshalToVT ¶
func (m *BillPayment) MarshalToVT(dAtA []byte) (int, error)
func (*BillPayment) MarshalVT ¶
func (m *BillPayment) MarshalVT() (dAtA []byte, err error)
func (*BillPayment) ProtoMessage ¶
func (*BillPayment) ProtoMessage()
func (*BillPayment) ProtoReflect ¶
func (x *BillPayment) ProtoReflect() protoreflect.Message
func (*BillPayment) Reset ¶
func (x *BillPayment) Reset()
func (*BillPayment) SizeVT ¶
func (m *BillPayment) SizeVT() (n int)
func (*BillPayment) String ¶
func (x *BillPayment) String() string
func (*BillPayment) UnmarshalVT ¶
func (m *BillPayment) UnmarshalVT(dAtA []byte) error
type BillShare ¶
type BillShare struct { // contains filtered or unexported fields }
func (*BillShare) Descriptor
deprecated
func (*BillShare) MarshalToSizedBufferVT ¶
func (*BillShare) ProtoMessage ¶
func (*BillShare) ProtoMessage()
func (*BillShare) ProtoReflect ¶
func (x *BillShare) ProtoReflect() protoreflect.Message
func (*BillShare) UnmarshalVT ¶
type NewBillRequest ¶
type NewBillRequest struct { Items []*BillItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` Payments []*BillPayment `protobuf:"bytes,2,rep,name=payments,proto3" json:"payments,omitempty"` // contains filtered or unexported fields }
func (*NewBillRequest) Descriptor
deprecated
func (*NewBillRequest) Descriptor() ([]byte, []int)
Deprecated: Use NewBillRequest.ProtoReflect.Descriptor instead.
func (*NewBillRequest) GetItems ¶
func (x *NewBillRequest) GetItems() []*BillItem
func (*NewBillRequest) GetPayments ¶
func (x *NewBillRequest) GetPayments() []*BillPayment
func (*NewBillRequest) MarshalToSizedBufferVT ¶
func (m *NewBillRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*NewBillRequest) MarshalToVT ¶
func (m *NewBillRequest) MarshalToVT(dAtA []byte) (int, error)
func (*NewBillRequest) MarshalVT ¶
func (m *NewBillRequest) MarshalVT() (dAtA []byte, err error)
func (*NewBillRequest) ProtoMessage ¶
func (*NewBillRequest) ProtoMessage()
func (*NewBillRequest) ProtoReflect ¶
func (x *NewBillRequest) ProtoReflect() protoreflect.Message
func (*NewBillRequest) Reset ¶
func (x *NewBillRequest) Reset()
func (*NewBillRequest) SizeVT ¶
func (m *NewBillRequest) SizeVT() (n int)
func (*NewBillRequest) String ¶
func (x *NewBillRequest) String() string
func (*NewBillRequest) UnmarshalVT ¶
func (m *NewBillRequest) UnmarshalVT(dAtA []byte) error
type NewBillResponse ¶
type NewBillResponse struct { BillId uint64 `protobuf:"varint,1,opt,name=bill_id,json=billId,proto3" json:"bill_id,omitempty"` // contains filtered or unexported fields }
func (*NewBillResponse) Descriptor
deprecated
func (*NewBillResponse) Descriptor() ([]byte, []int)
Deprecated: Use NewBillResponse.ProtoReflect.Descriptor instead.
func (*NewBillResponse) GetBillId ¶
func (x *NewBillResponse) GetBillId() uint64
func (*NewBillResponse) MarshalToSizedBufferVT ¶
func (m *NewBillResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*NewBillResponse) MarshalToVT ¶
func (m *NewBillResponse) MarshalToVT(dAtA []byte) (int, error)
func (*NewBillResponse) MarshalVT ¶
func (m *NewBillResponse) MarshalVT() (dAtA []byte, err error)
func (*NewBillResponse) ProtoMessage ¶
func (*NewBillResponse) ProtoMessage()
func (*NewBillResponse) ProtoReflect ¶
func (x *NewBillResponse) ProtoReflect() protoreflect.Message
func (*NewBillResponse) Reset ¶
func (x *NewBillResponse) Reset()
func (*NewBillResponse) SizeVT ¶
func (m *NewBillResponse) SizeVT() (n int)
func (*NewBillResponse) String ¶
func (x *NewBillResponse) String() string
func (*NewBillResponse) UnmarshalVT ¶
func (m *NewBillResponse) UnmarshalVT(dAtA []byte) error
type SplitTheBillServiceClient ¶
type SplitTheBillServiceClient interface {
NewBill(ctx context.Context, in *NewBillRequest, opts ...grpc.CallOption) (*NewBillResponse, error)
}
SplitTheBillServiceClient is the client API for SplitTheBillService 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 NewSplitTheBillServiceClient ¶
func NewSplitTheBillServiceClient(cc grpc.ClientConnInterface) SplitTheBillServiceClient
type SplitTheBillServiceServer ¶
type SplitTheBillServiceServer interface { NewBill(context.Context, *NewBillRequest) (*NewBillResponse, error) // contains filtered or unexported methods }
SplitTheBillServiceServer is the server API for SplitTheBillService service. All implementations must embed UnimplementedSplitTheBillServiceServer for forward compatibility
type UnimplementedSplitTheBillServiceServer ¶
type UnimplementedSplitTheBillServiceServer struct { }
UnimplementedSplitTheBillServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedSplitTheBillServiceServer) NewBill ¶
func (UnimplementedSplitTheBillServiceServer) NewBill(context.Context, *NewBillRequest) (*NewBillResponse, error)
type UnsafeSplitTheBillServiceServer ¶
type UnsafeSplitTheBillServiceServer interface {
// contains filtered or unexported methods
}
UnsafeSplitTheBillServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SplitTheBillServiceServer will result in compilation errors.