Documentation
¶
Overview ¶
Package ratewatcher is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterRateWatcherServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterRateWatcherServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RateWatcherServiceClient) error
- func RegisterRateWatcherServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterRateWatcherServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RateWatcherServiceServer) error
- func RegisterRateWatcherServiceServer(s grpc.ServiceRegistrar, srv RateWatcherServiceServer)
- type RateResponse
- type RateWatcherServiceClient
- type RateWatcherServiceServer
- type UnimplementedRateWatcherServiceServer
- type UnsafeRateWatcherServiceServer
Constants ¶
const (
RateWatcherService_GetRate_FullMethodName = "/ratewatcher.v1.RateWatcherService/GetRate"
)
Variables ¶
var File_v1_ratewatcher_rw_proto protoreflect.FileDescriptor
var RateWatcherService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ratewatcher.v1.RateWatcherService", HandlerType: (*RateWatcherServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetRate", Handler: _RateWatcherService_GetRate_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "v1/ratewatcher/rw.proto", }
RateWatcherService_ServiceDesc is the grpc.ServiceDesc for RateWatcherService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRateWatcherServiceHandler ¶
func RegisterRateWatcherServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterRateWatcherServiceHandler registers the http handlers for service RateWatcherService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterRateWatcherServiceHandlerClient ¶
func RegisterRateWatcherServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RateWatcherServiceClient) error
RegisterRateWatcherServiceHandlerClient registers the http handlers for service RateWatcherService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RateWatcherServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RateWatcherServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "RateWatcherServiceClient" to call the correct interceptors.
func RegisterRateWatcherServiceHandlerFromEndpoint ¶
func RegisterRateWatcherServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterRateWatcherServiceHandlerFromEndpoint is same as RegisterRateWatcherServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterRateWatcherServiceHandlerServer ¶
func RegisterRateWatcherServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RateWatcherServiceServer) error
RegisterRateWatcherServiceHandlerServer registers the http handlers for service RateWatcherService to "mux". UnaryRPC :call RateWatcherServiceServer 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 RegisterRateWatcherServiceHandlerFromEndpoint instead.
func RegisterRateWatcherServiceServer ¶
func RegisterRateWatcherServiceServer(s grpc.ServiceRegistrar, srv RateWatcherServiceServer)
Types ¶
type RateResponse ¶
type RateResponse struct { Rate float32 `protobuf:"fixed32,1,opt,name=rate,proto3" json:"rate,omitempty"` // contains filtered or unexported fields }
func (*RateResponse) Descriptor
deprecated
func (*RateResponse) Descriptor() ([]byte, []int)
Deprecated: Use RateResponse.ProtoReflect.Descriptor instead.
func (*RateResponse) GetRate ¶
func (x *RateResponse) GetRate() float32
func (*RateResponse) ProtoMessage ¶
func (*RateResponse) ProtoMessage()
func (*RateResponse) ProtoReflect ¶
func (x *RateResponse) ProtoReflect() protoreflect.Message
func (*RateResponse) Reset ¶
func (x *RateResponse) Reset()
func (*RateResponse) String ¶
func (x *RateResponse) String() string
type RateWatcherServiceClient ¶
type RateWatcherServiceClient interface {
GetRate(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*RateResponse, error)
}
RateWatcherServiceClient is the client API for RateWatcherService 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 NewRateWatcherServiceClient ¶
func NewRateWatcherServiceClient(cc grpc.ClientConnInterface) RateWatcherServiceClient
type RateWatcherServiceServer ¶
type RateWatcherServiceServer interface { GetRate(context.Context, *emptypb.Empty) (*RateResponse, error) // contains filtered or unexported methods }
RateWatcherServiceServer is the server API for RateWatcherService service. All implementations must embed UnimplementedRateWatcherServiceServer for forward compatibility
type UnimplementedRateWatcherServiceServer ¶
type UnimplementedRateWatcherServiceServer struct { }
UnimplementedRateWatcherServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedRateWatcherServiceServer) GetRate ¶
func (UnimplementedRateWatcherServiceServer) GetRate(context.Context, *emptypb.Empty) (*RateResponse, error)
type UnsafeRateWatcherServiceServer ¶
type UnsafeRateWatcherServiceServer interface {
// contains filtered or unexported methods
}
UnsafeRateWatcherServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RateWatcherServiceServer will result in compilation errors.