Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterWeatherServiceServer(s grpc.ServiceRegistrar, srv WeatherServiceServer)
- type LocationRequest
- func (*LocationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LocationRequest) GetLatitude() float64
- func (x *LocationRequest) GetLongitude() float64
- func (*LocationRequest) ProtoMessage()
- func (x *LocationRequest) ProtoReflect() protoreflect.Message
- func (x *LocationRequest) Reset()
- func (x *LocationRequest) String() string
- type UnimplementedWeatherServiceServer
- type UnsafeWeatherServiceServer
- type WeatherResponse
- func (*WeatherResponse) Descriptor() ([]byte, []int)deprecated
- func (x *WeatherResponse) GetHumidity() float64
- func (x *WeatherResponse) GetStatus() string
- func (x *WeatherResponse) GetTemperature() float64
- func (*WeatherResponse) ProtoMessage()
- func (x *WeatherResponse) ProtoReflect() protoreflect.Message
- func (x *WeatherResponse) Reset()
- func (x *WeatherResponse) String() string
- type WeatherServiceClient
- type WeatherServiceServer
- type WeatherService_StreamWeatherClient
- type WeatherService_StreamWeatherServer
Constants ¶
const ( WeatherService_GetWeather_FullMethodName = "/weather.WeatherService/GetWeather" WeatherService_StreamWeather_FullMethodName = "/weather.WeatherService/StreamWeather" )
Variables ¶
var File_weather_service_proto protoreflect.FileDescriptor
var WeatherService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "weather.WeatherService", HandlerType: (*WeatherServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetWeather", Handler: _WeatherService_GetWeather_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "StreamWeather", Handler: _WeatherService_StreamWeather_Handler, ServerStreams: true, }, }, Metadata: "weather_service.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 RegisterWeatherServiceServer ¶
func RegisterWeatherServiceServer(s grpc.ServiceRegistrar, srv WeatherServiceServer)
Types ¶
type LocationRequest ¶
type LocationRequest struct { Latitude float64 `protobuf:"fixed64,1,opt,name=latitude,proto3" json:"latitude,omitempty"` Longitude float64 `protobuf:"fixed64,2,opt,name=longitude,proto3" json:"longitude,omitempty"` // contains filtered or unexported fields }
func (*LocationRequest) Descriptor
deprecated
func (*LocationRequest) Descriptor() ([]byte, []int)
Deprecated: Use LocationRequest.ProtoReflect.Descriptor instead.
func (*LocationRequest) GetLatitude ¶
func (x *LocationRequest) GetLatitude() float64
func (*LocationRequest) GetLongitude ¶
func (x *LocationRequest) GetLongitude() float64
func (*LocationRequest) ProtoMessage ¶
func (*LocationRequest) ProtoMessage()
func (*LocationRequest) ProtoReflect ¶
func (x *LocationRequest) ProtoReflect() protoreflect.Message
func (*LocationRequest) Reset ¶
func (x *LocationRequest) Reset()
func (*LocationRequest) String ¶
func (x *LocationRequest) 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) GetWeather ¶
func (UnimplementedWeatherServiceServer) GetWeather(context.Context, *LocationRequest) (*WeatherResponse, error)
func (UnimplementedWeatherServiceServer) StreamWeather ¶
func (UnimplementedWeatherServiceServer) StreamWeather(*LocationRequest, grpc.ServerStreamingServer[WeatherResponse]) 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 WeatherResponse ¶
type WeatherResponse struct { Temperature float64 `protobuf:"fixed64,1,opt,name=temperature,proto3" json:"temperature,omitempty"` Humidity float64 `protobuf:"fixed64,2,opt,name=humidity,proto3" json:"humidity,omitempty"` Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*WeatherResponse) Descriptor
deprecated
func (*WeatherResponse) Descriptor() ([]byte, []int)
Deprecated: Use WeatherResponse.ProtoReflect.Descriptor instead.
func (*WeatherResponse) GetHumidity ¶
func (x *WeatherResponse) GetHumidity() float64
func (*WeatherResponse) GetStatus ¶
func (x *WeatherResponse) GetStatus() string
func (*WeatherResponse) GetTemperature ¶
func (x *WeatherResponse) GetTemperature() float64
func (*WeatherResponse) ProtoMessage ¶
func (*WeatherResponse) ProtoMessage()
func (*WeatherResponse) ProtoReflect ¶
func (x *WeatherResponse) ProtoReflect() protoreflect.Message
func (*WeatherResponse) Reset ¶
func (x *WeatherResponse) Reset()
func (*WeatherResponse) String ¶
func (x *WeatherResponse) String() string
type WeatherServiceClient ¶
type WeatherServiceClient interface { GetWeather(ctx context.Context, in *LocationRequest, opts ...grpc.CallOption) (*WeatherResponse, error) StreamWeather(ctx context.Context, in *LocationRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[WeatherResponse], 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 { GetWeather(context.Context, *LocationRequest) (*WeatherResponse, error) StreamWeather(*LocationRequest, grpc.ServerStreamingServer[WeatherResponse]) error // contains filtered or unexported methods }
WeatherServiceServer is the server API for WeatherService service. All implementations must embed UnimplementedWeatherServiceServer for forward compatibility.
type WeatherService_StreamWeatherClient ¶
type WeatherService_StreamWeatherClient = grpc.ServerStreamingClient[WeatherResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WeatherService_StreamWeatherServer ¶
type WeatherService_StreamWeatherServer = grpc.ServerStreamingServer[WeatherResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.