split_the_billv1

package
v0.0.0-...-b4821ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package split_the_billv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	SplitTheBillService_NewBill_FullMethodName = "/dolgovnya.split_the_bill.v1.SplitTheBillService/NewBill"
)

Variables

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var File_dolgovnya_split_the_bill_v1_split_the_bill_proto protoreflect.FileDescriptor
View Source
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"`
	Shares      []*BillShare     `protobuf:"bytes,5,rep,name=shares,proto3" json:"shares,omitempty"`
	// contains filtered or unexported fields
}

func (*BillItem) Descriptor deprecated

func (*BillItem) Descriptor() ([]byte, []int)

Deprecated: Use BillItem.ProtoReflect.Descriptor instead.

func (*BillItem) GetPricePerOne

func (x *BillItem) GetPricePerOne() *money.Money

func (*BillItem) GetQuantity

func (x *BillItem) GetQuantity() *decimal.Decimal

func (*BillItem) GetShares

func (x *BillItem) GetShares() []*BillShare

func (*BillItem) GetTitle

func (x *BillItem) GetTitle() string

func (*BillItem) GetType

func (x *BillItem) GetType() int64

func (*BillItem) MarshalToSizedBufferVT

func (m *BillItem) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*BillItem) MarshalToVT

func (m *BillItem) MarshalToVT(dAtA []byte) (int, error)

func (*BillItem) MarshalVT

func (m *BillItem) MarshalVT() (dAtA []byte, err error)

func (*BillItem) ProtoMessage

func (*BillItem) ProtoMessage()

func (*BillItem) ProtoReflect

func (x *BillItem) ProtoReflect() protoreflect.Message

func (*BillItem) Reset

func (x *BillItem) Reset()

func (*BillItem) SizeVT

func (m *BillItem) SizeVT() (n int)

func (*BillItem) String

func (x *BillItem) String() string

func (*BillItem) UnmarshalVT

func (m *BillItem) UnmarshalVT(dAtA []byte) error

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 {
	UserId int64  `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Share  uint64 `protobuf:"varint,2,opt,name=share,proto3" json:"share,omitempty"`
	// contains filtered or unexported fields
}

func (*BillShare) Descriptor deprecated

func (*BillShare) Descriptor() ([]byte, []int)

Deprecated: Use BillShare.ProtoReflect.Descriptor instead.

func (*BillShare) GetShare

func (x *BillShare) GetShare() uint64

func (*BillShare) GetUserId

func (x *BillShare) GetUserId() int64

func (*BillShare) MarshalToSizedBufferVT

func (m *BillShare) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*BillShare) MarshalToVT

func (m *BillShare) MarshalToVT(dAtA []byte) (int, error)

func (*BillShare) MarshalVT

func (m *BillShare) MarshalVT() (dAtA []byte, err error)

func (*BillShare) ProtoMessage

func (*BillShare) ProtoMessage()

func (*BillShare) ProtoReflect

func (x *BillShare) ProtoReflect() protoreflect.Message

func (*BillShare) Reset

func (x *BillShare) Reset()

func (*BillShare) SizeVT

func (m *BillShare) SizeVT() (n int)

func (*BillShare) String

func (x *BillShare) String() string

func (*BillShare) UnmarshalVT

func (m *BillShare) UnmarshalVT(dAtA []byte) error

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.

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

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL