Documentation
¶
Overview ¶
Package location_weather is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterWeatherServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterWeatherServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WeatherServiceClient) error
- func RegisterWeatherServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterWeatherServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WeatherServiceServer) error
- func RegisterWeatherServiceServer(s grpc.ServiceRegistrar, srv WeatherServiceServer)
- type GetLocationByIdRequest
- func (*GetLocationByIdRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetLocationByIdRequest) GetLocationId() int32
- func (*GetLocationByIdRequest) ProtoMessage()
- func (x *GetLocationByIdRequest) ProtoReflect() protoreflect.Message
- func (x *GetLocationByIdRequest) Reset()
- func (x *GetLocationByIdRequest) String() string
- type GetLocationByIdResponce
- func (*GetLocationByIdResponce) Descriptor() ([]byte, []int)deprecated
- func (x *GetLocationByIdResponce) GetWeather() *WeatherData
- func (*GetLocationByIdResponce) ProtoMessage()
- func (x *GetLocationByIdResponce) ProtoReflect() protoreflect.Message
- func (x *GetLocationByIdResponce) Reset()
- func (x *GetLocationByIdResponce) String() string
- type UnimplementedWeatherServiceServer
- type UnsafeWeatherServiceServer
- type WeatherData
- func (*WeatherData) Descriptor() ([]byte, []int)deprecated
- func (x *WeatherData) GetCloud() int32
- func (x *WeatherData) GetHumidity() int32
- func (x *WeatherData) GetLocationId() int32
- func (x *WeatherData) GetPrecip() float64
- func (x *WeatherData) GetPressure() float64
- func (x *WeatherData) GetTemperature() float64
- func (x *WeatherData) GetUpdateAt() string
- func (x *WeatherData) GetWindSpeed() float64
- func (*WeatherData) ProtoMessage()
- func (x *WeatherData) ProtoReflect() protoreflect.Message
- func (x *WeatherData) Reset()
- func (x *WeatherData) String() string
- type WeatherServiceClient
- type WeatherServiceServer
Constants ¶
const (
WeatherService_GetLocationById_FullMethodName = "/location_weather.WeatherService/GetLocationById"
)
Variables ¶
var File_location_weather_proto protoreflect.FileDescriptor
var WeatherService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "location_weather.WeatherService", HandlerType: (*WeatherServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetLocationById", Handler: _WeatherService_GetLocationById_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "location_weather.proto", }
WeatherService_ServiceDesc is the grpc.ServiceDesc for WeatherService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWeatherServiceHandler ¶
func RegisterWeatherServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterWeatherServiceHandler registers the http handlers for service WeatherService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterWeatherServiceHandlerClient ¶
func RegisterWeatherServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WeatherServiceClient) error
RegisterWeatherServiceHandlerClient registers the http handlers for service WeatherService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WeatherServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WeatherServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WeatherServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterWeatherServiceHandlerFromEndpoint ¶
func RegisterWeatherServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterWeatherServiceHandlerFromEndpoint is same as RegisterWeatherServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterWeatherServiceHandlerServer ¶
func RegisterWeatherServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WeatherServiceServer) error
RegisterWeatherServiceHandlerServer registers the http handlers for service WeatherService to "mux". UnaryRPC :call WeatherServiceServer 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 RegisterWeatherServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterWeatherServiceServer ¶
func RegisterWeatherServiceServer(s grpc.ServiceRegistrar, srv WeatherServiceServer)
Types ¶
type GetLocationByIdRequest ¶
type GetLocationByIdRequest struct { LocationId int32 `protobuf:"varint,1,opt,name=locationId,proto3" json:"locationId,omitempty"` // contains filtered or unexported fields }
func (*GetLocationByIdRequest) Descriptor
deprecated
func (*GetLocationByIdRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetLocationByIdRequest.ProtoReflect.Descriptor instead.
func (*GetLocationByIdRequest) GetLocationId ¶
func (x *GetLocationByIdRequest) GetLocationId() int32
func (*GetLocationByIdRequest) ProtoMessage ¶
func (*GetLocationByIdRequest) ProtoMessage()
func (*GetLocationByIdRequest) ProtoReflect ¶
func (x *GetLocationByIdRequest) ProtoReflect() protoreflect.Message
func (*GetLocationByIdRequest) Reset ¶
func (x *GetLocationByIdRequest) Reset()
func (*GetLocationByIdRequest) String ¶
func (x *GetLocationByIdRequest) String() string
type GetLocationByIdResponce ¶
type GetLocationByIdResponce struct { Weather *WeatherData `protobuf:"bytes,1,opt,name=Weather,proto3" json:"Weather,omitempty"` // contains filtered or unexported fields }
func (*GetLocationByIdResponce) Descriptor
deprecated
func (*GetLocationByIdResponce) Descriptor() ([]byte, []int)
Deprecated: Use GetLocationByIdResponce.ProtoReflect.Descriptor instead.
func (*GetLocationByIdResponce) GetWeather ¶
func (x *GetLocationByIdResponce) GetWeather() *WeatherData
func (*GetLocationByIdResponce) ProtoMessage ¶
func (*GetLocationByIdResponce) ProtoMessage()
func (*GetLocationByIdResponce) ProtoReflect ¶
func (x *GetLocationByIdResponce) ProtoReflect() protoreflect.Message
func (*GetLocationByIdResponce) Reset ¶
func (x *GetLocationByIdResponce) Reset()
func (*GetLocationByIdResponce) String ¶
func (x *GetLocationByIdResponce) String() string
type UnimplementedWeatherServiceServer ¶
type UnimplementedWeatherServiceServer struct{}
UnimplementedWeatherServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedWeatherServiceServer) GetLocationById ¶
func (UnimplementedWeatherServiceServer) GetLocationById(context.Context, *GetLocationByIdRequest) (*GetLocationByIdResponce, error)
type UnsafeWeatherServiceServer ¶
type UnsafeWeatherServiceServer interface {
// contains filtered or unexported methods
}
UnsafeWeatherServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WeatherServiceServer will result in compilation errors.
type WeatherData ¶
type WeatherData struct { LocationId int32 `protobuf:"varint,1,opt,name=LocationId,proto3" json:"LocationId,omitempty"` Temperature float64 `protobuf:"fixed64,2,opt,name=Temperature,proto3" json:"Temperature,omitempty"` Humidity int32 `protobuf:"varint,3,opt,name=Humidity,proto3" json:"Humidity,omitempty"` WindSpeed float64 `protobuf:"fixed64,4,opt,name=WindSpeed,proto3" json:"WindSpeed,omitempty"` Pressure float64 `protobuf:"fixed64,5,opt,name=Pressure,proto3" json:"Pressure,omitempty"` Precip float64 `protobuf:"fixed64,6,opt,name=Precip,proto3" json:"Precip,omitempty"` Cloud int32 `protobuf:"varint,7,opt,name=Cloud,proto3" json:"Cloud,omitempty"` UpdateAt string `protobuf:"bytes,8,opt,name=UpdateAt,proto3" json:"UpdateAt,omitempty"` // contains filtered or unexported fields }
func (*WeatherData) Descriptor
deprecated
func (*WeatherData) Descriptor() ([]byte, []int)
Deprecated: Use WeatherData.ProtoReflect.Descriptor instead.
func (*WeatherData) GetCloud ¶
func (x *WeatherData) GetCloud() int32
func (*WeatherData) GetHumidity ¶
func (x *WeatherData) GetHumidity() int32
func (*WeatherData) GetLocationId ¶
func (x *WeatherData) GetLocationId() int32
func (*WeatherData) GetPrecip ¶
func (x *WeatherData) GetPrecip() float64
func (*WeatherData) GetPressure ¶
func (x *WeatherData) GetPressure() float64
func (*WeatherData) GetTemperature ¶
func (x *WeatherData) GetTemperature() float64
func (*WeatherData) GetUpdateAt ¶
func (x *WeatherData) GetUpdateAt() string
func (*WeatherData) GetWindSpeed ¶
func (x *WeatherData) GetWindSpeed() float64
func (*WeatherData) ProtoMessage ¶
func (*WeatherData) ProtoMessage()
func (*WeatherData) ProtoReflect ¶
func (x *WeatherData) ProtoReflect() protoreflect.Message
func (*WeatherData) Reset ¶
func (x *WeatherData) Reset()
func (*WeatherData) String ¶
func (x *WeatherData) String() string
type WeatherServiceClient ¶
type WeatherServiceClient interface {
GetLocationById(ctx context.Context, in *GetLocationByIdRequest, opts ...grpc.CallOption) (*GetLocationByIdResponce, error)
}
WeatherServiceClient is the client API for WeatherService 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 NewWeatherServiceClient ¶
func NewWeatherServiceClient(cc grpc.ClientConnInterface) WeatherServiceClient
type WeatherServiceServer ¶
type WeatherServiceServer interface { GetLocationById(context.Context, *GetLocationByIdRequest) (*GetLocationByIdResponce, error) // contains filtered or unexported methods }
WeatherServiceServer is the server API for WeatherService service. All implementations must embed UnimplementedWeatherServiceServer for forward compatibility.