Documentation ¶
Overview ¶
Package pricing is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterPricingServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPricingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PricingServiceClient) error
- func RegisterPricingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPricingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PricingServiceServer) error
- func RegisterPricingServiceServer(s grpc.ServiceRegistrar, srv PricingServiceServer)
- type GetPriceRequest
- func (*GetPriceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetPriceRequest) GetCourseId() int64
- func (x *GetPriceRequest) GetDatetime() string
- func (x *GetPriceRequest) GetGolfers() int64
- func (*GetPriceRequest) ProtoMessage()
- func (x *GetPriceRequest) ProtoReflect() protoreflect.Message
- func (x *GetPriceRequest) Reset()
- func (x *GetPriceRequest) String() string
- type GetPriceResponse
- func (*GetPriceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetPriceResponse) GetCourseId() string
- func (x *GetPriceResponse) GetDatetime() string
- func (x *GetPriceResponse) GetDiscounted() bool
- func (x *GetPriceResponse) GetOriginalPrice() float64
- func (x *GetPriceResponse) GetPrice() float64
- func (*GetPriceResponse) ProtoMessage()
- func (x *GetPriceResponse) ProtoReflect() protoreflect.Message
- func (x *GetPriceResponse) Reset()
- func (x *GetPriceResponse) String() string
- type PricingServiceClient
- type PricingServiceServer
- type PricingService_GetPriceStreamClient
- type PricingService_GetPriceStreamServer
- type UnimplementedPricingServiceServer
- type UnsafePricingServiceServer
Constants ¶
const ( PricingService_GetPrice_FullMethodName = "/pricing.PricingService/GetPrice" PricingService_GetPriceStream_FullMethodName = "/pricing.PricingService/GetPriceStream" )
Variables ¶
var File_protobufs_pricing_pricing_proto protoreflect.FileDescriptor
var PricingService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pricing.PricingService", HandlerType: (*PricingServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetPrice", Handler: _PricingService_GetPrice_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "GetPriceStream", Handler: _PricingService_GetPriceStream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "protobufs/pricing/pricing.proto", }
PricingService_ServiceDesc is the grpc.ServiceDesc for PricingService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPricingServiceHandler ¶
func RegisterPricingServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterPricingServiceHandler registers the http handlers for service PricingService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPricingServiceHandlerClient ¶
func RegisterPricingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PricingServiceClient) error
RegisterPricingServiceHandlerClient registers the http handlers for service PricingService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PricingServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PricingServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PricingServiceClient" to call the correct interceptors.
func RegisterPricingServiceHandlerFromEndpoint ¶
func RegisterPricingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPricingServiceHandlerFromEndpoint is same as RegisterPricingServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPricingServiceHandlerServer ¶
func RegisterPricingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PricingServiceServer) error
RegisterPricingServiceHandlerServer registers the http handlers for service PricingService to "mux". UnaryRPC :call PricingServiceServer 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 RegisterPricingServiceHandlerFromEndpoint instead.
func RegisterPricingServiceServer ¶
func RegisterPricingServiceServer(s grpc.ServiceRegistrar, srv PricingServiceServer)
Types ¶
type GetPriceRequest ¶
type GetPriceRequest struct { CourseId int64 `protobuf:"varint,1,opt,name=course_id,json=courseId,proto3" json:"course_id,omitempty"` Datetime string `protobuf:"bytes,2,opt,name=datetime,proto3" json:"datetime,omitempty"` Golfers int64 `protobuf:"varint,3,opt,name=golfers,proto3" json:"golfers,omitempty"` // contains filtered or unexported fields }
func (*GetPriceRequest) Descriptor
deprecated
func (*GetPriceRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPriceRequest.ProtoReflect.Descriptor instead.
func (*GetPriceRequest) GetCourseId ¶
func (x *GetPriceRequest) GetCourseId() int64
func (*GetPriceRequest) GetDatetime ¶
func (x *GetPriceRequest) GetDatetime() string
func (*GetPriceRequest) GetGolfers ¶
func (x *GetPriceRequest) GetGolfers() int64
func (*GetPriceRequest) ProtoMessage ¶
func (*GetPriceRequest) ProtoMessage()
func (*GetPriceRequest) ProtoReflect ¶
func (x *GetPriceRequest) ProtoReflect() protoreflect.Message
func (*GetPriceRequest) Reset ¶
func (x *GetPriceRequest) Reset()
func (*GetPriceRequest) String ¶
func (x *GetPriceRequest) String() string
type GetPriceResponse ¶
type GetPriceResponse struct { Price float64 `protobuf:"fixed64,1,opt,name=price,proto3" json:"price,omitempty"` CourseId string `protobuf:"bytes,2,opt,name=course_id,json=courseId,proto3" json:"course_id,omitempty"` Datetime string `protobuf:"bytes,3,opt,name=datetime,proto3" json:"datetime,omitempty"` OriginalPrice float64 `protobuf:"fixed64,4,opt,name=original_price,json=originalPrice,proto3" json:"original_price,omitempty"` Discounted bool `protobuf:"varint,5,opt,name=discounted,proto3" json:"discounted,omitempty"` // contains filtered or unexported fields }
func (*GetPriceResponse) Descriptor
deprecated
func (*GetPriceResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetPriceResponse.ProtoReflect.Descriptor instead.
func (*GetPriceResponse) GetCourseId ¶
func (x *GetPriceResponse) GetCourseId() string
func (*GetPriceResponse) GetDatetime ¶
func (x *GetPriceResponse) GetDatetime() string
func (*GetPriceResponse) GetDiscounted ¶
func (x *GetPriceResponse) GetDiscounted() bool
func (*GetPriceResponse) GetOriginalPrice ¶
func (x *GetPriceResponse) GetOriginalPrice() float64
func (*GetPriceResponse) GetPrice ¶
func (x *GetPriceResponse) GetPrice() float64
func (*GetPriceResponse) ProtoMessage ¶
func (*GetPriceResponse) ProtoMessage()
func (*GetPriceResponse) ProtoReflect ¶
func (x *GetPriceResponse) ProtoReflect() protoreflect.Message
func (*GetPriceResponse) Reset ¶
func (x *GetPriceResponse) Reset()
func (*GetPriceResponse) String ¶
func (x *GetPriceResponse) String() string
type PricingServiceClient ¶
type PricingServiceClient interface { GetPrice(ctx context.Context, in *GetPriceRequest, opts ...grpc.CallOption) (*GetPriceResponse, error) GetPriceStream(ctx context.Context, opts ...grpc.CallOption) (PricingService_GetPriceStreamClient, error) }
PricingServiceClient is the client API for PricingService 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 NewPricingServiceClient ¶
func NewPricingServiceClient(cc grpc.ClientConnInterface) PricingServiceClient
type PricingServiceServer ¶
type PricingServiceServer interface { GetPrice(context.Context, *GetPriceRequest) (*GetPriceResponse, error) GetPriceStream(PricingService_GetPriceStreamServer) error // contains filtered or unexported methods }
PricingServiceServer is the server API for PricingService service. All implementations must embed UnimplementedPricingServiceServer for forward compatibility
type PricingService_GetPriceStreamClient ¶
type PricingService_GetPriceStreamClient interface { Send(*GetPriceRequest) error Recv() (*GetPriceResponse, error) grpc.ClientStream }
type PricingService_GetPriceStreamServer ¶
type PricingService_GetPriceStreamServer interface { Send(*GetPriceResponse) error Recv() (*GetPriceRequest, error) grpc.ServerStream }
type UnimplementedPricingServiceServer ¶
type UnimplementedPricingServiceServer struct { }
UnimplementedPricingServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedPricingServiceServer) GetPrice ¶
func (UnimplementedPricingServiceServer) GetPrice(context.Context, *GetPriceRequest) (*GetPriceResponse, error)
func (UnimplementedPricingServiceServer) GetPriceStream ¶
func (UnimplementedPricingServiceServer) GetPriceStream(PricingService_GetPriceStreamServer) error
type UnsafePricingServiceServer ¶
type UnsafePricingServiceServer interface {
// contains filtered or unexported methods
}
UnsafePricingServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PricingServiceServer will result in compilation errors.