Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterWeatherServiceServer(s grpc.ServiceRegistrar, srv WeatherServiceServer)
- type API
- type GeoSet
- type GetCurrentReportRequest
- func (*GetCurrentReportRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetCurrentReportRequest) GetLatitude() float64
- func (x *GetCurrentReportRequest) GetLongitude() float64
- func (*GetCurrentReportRequest) ProtoMessage()
- func (x *GetCurrentReportRequest) ProtoReflect() protoreflect.Message
- func (x *GetCurrentReportRequest) Reset()
- func (x *GetCurrentReportRequest) String() string
- type GetCurrentReportResponse
- func (*GetCurrentReportResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetCurrentReportResponse) GetReport() *WeatherReport
- func (x *GetCurrentReportResponse) GetStationName() string
- func (*GetCurrentReportResponse) ProtoMessage()
- func (x *GetCurrentReportResponse) ProtoReflect() protoreflect.Message
- func (x *GetCurrentReportResponse) Reset()
- func (x *GetCurrentReportResponse) String() string
- type GetForecastRequest
- func (*GetForecastRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetForecastRequest) GetLatitude() float64
- func (x *GetForecastRequest) GetLongitude() float64
- func (*GetForecastRequest) ProtoMessage()
- func (x *GetForecastRequest) ProtoReflect() protoreflect.Message
- func (x *GetForecastRequest) Reset()
- func (x *GetForecastRequest) String() string
- type GetForecastResponse
- func (*GetForecastResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetForecastResponse) GetForecastRecords() []*WeatherForecast
- func (*GetForecastResponse) ProtoMessage()
- func (x *GetForecastResponse) ProtoReflect() protoreflect.Message
- func (x *GetForecastResponse) Reset()
- func (x *GetForecastResponse) String() string
- type Station
- type UnimplementedWeatherServiceServer
- type UnsafeWeatherServiceServer
- type WeatherCondition
- func (*WeatherCondition) Descriptor() ([]byte, []int)deprecated
- func (x *WeatherCondition) GetDewPoint() float32
- func (x *WeatherCondition) GetHumidity() int32
- func (x *WeatherCondition) GetPressure() float32
- func (x *WeatherCondition) GetSummary() string
- func (x *WeatherCondition) GetSummaryIcon() WeatherIcon
- func (x *WeatherCondition) GetTemperature() float32
- func (x *WeatherCondition) GetUvIndex() int32
- func (x *WeatherCondition) GetVisibility() int32
- func (x *WeatherCondition) GetWindChill() float32
- func (x *WeatherCondition) GetWindSpeed() int32
- func (*WeatherCondition) ProtoMessage()
- func (x *WeatherCondition) ProtoReflect() protoreflect.Message
- func (x *WeatherCondition) Reset()
- func (x *WeatherCondition) String() string
- type WeatherForecast
- func (*WeatherForecast) Descriptor() ([]byte, []int)deprecated
- func (x *WeatherForecast) GetConditions() *WeatherCondition
- func (x *WeatherForecast) GetCreatedAt() *timestamppb.Timestamp
- func (x *WeatherForecast) GetForecastId() string
- func (x *WeatherForecast) GetForecastedFor() *timestamppb.Timestamp
- func (x *WeatherForecast) GetUpdatedAt() *timestamppb.Timestamp
- func (*WeatherForecast) ProtoMessage()
- func (x *WeatherForecast) ProtoReflect() protoreflect.Message
- func (x *WeatherForecast) Reset()
- func (x *WeatherForecast) String() string
- type WeatherIcon
- func (WeatherIcon) Descriptor() protoreflect.EnumDescriptor
- func (x WeatherIcon) Enum() *WeatherIcon
- func (WeatherIcon) EnumDescriptor() ([]byte, []int)deprecated
- func (x WeatherIcon) Number() protoreflect.EnumNumber
- func (x WeatherIcon) String() string
- func (WeatherIcon) Type() protoreflect.EnumType
- type WeatherReport
- func (*WeatherReport) Descriptor() ([]byte, []int)deprecated
- func (x *WeatherReport) GetConditions() *WeatherCondition
- func (x *WeatherReport) GetCreatedAt() *timestamppb.Timestamp
- func (x *WeatherReport) GetObservationId() string
- func (x *WeatherReport) GetObservedAt() *timestamppb.Timestamp
- func (x *WeatherReport) GetUpdatedAt() *timestamppb.Timestamp
- func (*WeatherReport) ProtoMessage()
- func (x *WeatherReport) ProtoReflect() protoreflect.Message
- func (x *WeatherReport) Reset()
- func (x *WeatherReport) String() string
- type WeatherServiceClient
- type WeatherServiceServer
Constants ¶
const ( WeatherService_GetCurrentReport_FullMethodName = "/faltung.nerves.weather.WeatherService/GetCurrentReport" WeatherService_GetForecast_FullMethodName = "/faltung.nerves.weather.WeatherService/GetForecast" )
Variables ¶
var ( WeatherIcon_name = map[int32]string{ 0: "SUNNY", 1: "CLOUDY", 2: "PARTIALLY_CLOUDY", 3: "MOSTLY_CLOUDY", 4: "RAIN", 5: "CHANCE_OF_RAIN", 6: "SNOW", 7: "CHANCE_OF_SNOW", 8: "SNOW_SHOWERS", 9: "THUNDERSTORMS", 10: "FOG", } WeatherIcon_value = map[string]int32{ "SUNNY": 0, "CLOUDY": 1, "PARTIALLY_CLOUDY": 2, "MOSTLY_CLOUDY": 3, "RAIN": 4, "CHANCE_OF_RAIN": 5, "SNOW": 6, "CHANCE_OF_SNOW": 7, "SNOW_SHOWERS": 8, "THUNDERSTORMS": 9, "FOG": 10, } )
Enum value maps for WeatherIcon.
var ( // ErrLocationNotFound is returned if the supplied lat/lon value can't be found. ErrLocationNotFound = status.New(codes.NotFound, "location not found") )
var File_weather_proto protoreflect.FileDescriptor
var WeatherService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "faltung.nerves.weather.WeatherService", HandlerType: (*WeatherServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetCurrentReport", Handler: _WeatherService_GetCurrentReport_Handler, }, { MethodName: "GetForecast", Handler: _WeatherService_GetForecast_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "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 RegisterWeatherServiceServer ¶
func RegisterWeatherServiceServer(s grpc.ServiceRegistrar, srv WeatherServiceServer)
Types ¶
type API ¶
type API struct { UnsafeWeatherServiceServer // contains filtered or unexported fields }
API is an implementation of the WeatherService server.
func (*API) GetCurrentReport ¶
func (api *API) GetCurrentReport(ctx context.Context, req *GetCurrentReportRequest) (*GetCurrentReportResponse, error)
GetCurrentReport gets a weather report
func (*API) GetForecast ¶
func (api *API) GetForecast(ctx context.Context, req *GetForecastRequest) (*GetForecastResponse, error)
GetForecast gets a weather forecast.
func (*API) RegisterStation ¶
RegisterStation takes the supplied station and adds it to the queryable set.
type GeoSet ¶
type GeoSet struct {
// contains filtered or unexported fields
}
GeoSet is a collection that allows for values to be stored by their latitude and longitude; and allows for lookups to find the entry closest to the supplied latitude and longitude.
type GetCurrentReportRequest ¶
type GetCurrentReportRequest 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 (*GetCurrentReportRequest) Descriptor
deprecated
func (*GetCurrentReportRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetCurrentReportRequest.ProtoReflect.Descriptor instead.
func (*GetCurrentReportRequest) GetLatitude ¶
func (x *GetCurrentReportRequest) GetLatitude() float64
func (*GetCurrentReportRequest) GetLongitude ¶
func (x *GetCurrentReportRequest) GetLongitude() float64
func (*GetCurrentReportRequest) ProtoMessage ¶
func (*GetCurrentReportRequest) ProtoMessage()
func (*GetCurrentReportRequest) ProtoReflect ¶
func (x *GetCurrentReportRequest) ProtoReflect() protoreflect.Message
func (*GetCurrentReportRequest) Reset ¶
func (x *GetCurrentReportRequest) Reset()
func (*GetCurrentReportRequest) String ¶
func (x *GetCurrentReportRequest) String() string
type GetCurrentReportResponse ¶
type GetCurrentReportResponse struct { Report *WeatherReport `protobuf:"bytes,1,opt,name=report,proto3" json:"report,omitempty"` StationName string `protobuf:"bytes,2,opt,name=station_name,json=stationName,proto3" json:"station_name,omitempty"` // contains filtered or unexported fields }
func (*GetCurrentReportResponse) Descriptor
deprecated
func (*GetCurrentReportResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetCurrentReportResponse.ProtoReflect.Descriptor instead.
func (*GetCurrentReportResponse) GetReport ¶
func (x *GetCurrentReportResponse) GetReport() *WeatherReport
func (*GetCurrentReportResponse) GetStationName ¶
func (x *GetCurrentReportResponse) GetStationName() string
func (*GetCurrentReportResponse) ProtoMessage ¶
func (*GetCurrentReportResponse) ProtoMessage()
func (*GetCurrentReportResponse) ProtoReflect ¶
func (x *GetCurrentReportResponse) ProtoReflect() protoreflect.Message
func (*GetCurrentReportResponse) Reset ¶
func (x *GetCurrentReportResponse) Reset()
func (*GetCurrentReportResponse) String ¶
func (x *GetCurrentReportResponse) String() string
type GetForecastRequest ¶
type GetForecastRequest 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 (*GetForecastRequest) Descriptor
deprecated
func (*GetForecastRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetForecastRequest.ProtoReflect.Descriptor instead.
func (*GetForecastRequest) GetLatitude ¶
func (x *GetForecastRequest) GetLatitude() float64
func (*GetForecastRequest) GetLongitude ¶
func (x *GetForecastRequest) GetLongitude() float64
func (*GetForecastRequest) ProtoMessage ¶
func (*GetForecastRequest) ProtoMessage()
func (*GetForecastRequest) ProtoReflect ¶
func (x *GetForecastRequest) ProtoReflect() protoreflect.Message
func (*GetForecastRequest) Reset ¶
func (x *GetForecastRequest) Reset()
func (*GetForecastRequest) String ¶
func (x *GetForecastRequest) String() string
type GetForecastResponse ¶
type GetForecastResponse struct { ForecastRecords []*WeatherForecast `protobuf:"bytes,1,rep,name=forecast_records,json=forecastRecords,proto3" json:"forecast_records,omitempty"` // contains filtered or unexported fields }
func (*GetForecastResponse) Descriptor
deprecated
func (*GetForecastResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetForecastResponse.ProtoReflect.Descriptor instead.
func (*GetForecastResponse) GetForecastRecords ¶
func (x *GetForecastResponse) GetForecastRecords() []*WeatherForecast
func (*GetForecastResponse) ProtoMessage ¶
func (*GetForecastResponse) ProtoMessage()
func (*GetForecastResponse) ProtoReflect ¶
func (x *GetForecastResponse) ProtoReflect() protoreflect.Message
func (*GetForecastResponse) Reset ¶
func (x *GetForecastResponse) Reset()
func (*GetForecastResponse) String ¶
func (x *GetForecastResponse) String() string
type Station ¶
type Station interface { Name() string Latitude() float64 Longitude() float64 GetReport(ctx context.Context) (*WeatherReport, error) GetForecast(ctx context.Context) ([]*WeatherForecast, error) }
Station represents a single weather station location.
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) GetCurrentReport ¶
func (UnimplementedWeatherServiceServer) GetCurrentReport(context.Context, *GetCurrentReportRequest) (*GetCurrentReportResponse, error)
func (UnimplementedWeatherServiceServer) GetForecast ¶
func (UnimplementedWeatherServiceServer) GetForecast(context.Context, *GetForecastRequest) (*GetForecastResponse, 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 WeatherCondition ¶
type WeatherCondition struct { SummaryIcon WeatherIcon `` /* 136-byte string literal not displayed */ // In Celsius. Temperature float32 `protobuf:"fixed32,21,opt,name=temperature,proto3" json:"temperature,omitempty"` // In Celsius. May not be set if there are no wind conditions. WindChill float32 `protobuf:"fixed32,22,opt,name=wind_chill,json=windChill,proto3" json:"wind_chill,omitempty"` // In Celsius. DewPoint float32 `protobuf:"fixed32,23,opt,name=dew_point,json=dewPoint,proto3" json:"dew_point,omitempty"` // A % out of 100 Humidity int32 `protobuf:"varint,24,opt,name=humidity,proto3" json:"humidity,omitempty"` // In kilopascals (kPa) Pressure float32 `protobuf:"fixed32,25,opt,name=pressure,proto3" json:"pressure,omitempty"` // In km/hr WindSpeed int32 `protobuf:"varint,26,opt,name=wind_speed,json=windSpeed,proto3" json:"wind_speed,omitempty"` // In km Visibility int32 `protobuf:"varint,27,opt,name=visibility,proto3" json:"visibility,omitempty"` UvIndex int32 `protobuf:"varint,28,opt,name=uv_index,json=uvIndex,proto3" json:"uv_index,omitempty"` Summary string `protobuf:"bytes,29,opt,name=summary,proto3" json:"summary,omitempty"` // contains filtered or unexported fields }
func (*WeatherCondition) Descriptor
deprecated
func (*WeatherCondition) Descriptor() ([]byte, []int)
Deprecated: Use WeatherCondition.ProtoReflect.Descriptor instead.
func (*WeatherCondition) GetDewPoint ¶
func (x *WeatherCondition) GetDewPoint() float32
func (*WeatherCondition) GetHumidity ¶
func (x *WeatherCondition) GetHumidity() int32
func (*WeatherCondition) GetPressure ¶
func (x *WeatherCondition) GetPressure() float32
func (*WeatherCondition) GetSummary ¶
func (x *WeatherCondition) GetSummary() string
func (*WeatherCondition) GetSummaryIcon ¶
func (x *WeatherCondition) GetSummaryIcon() WeatherIcon
func (*WeatherCondition) GetTemperature ¶
func (x *WeatherCondition) GetTemperature() float32
func (*WeatherCondition) GetUvIndex ¶
func (x *WeatherCondition) GetUvIndex() int32
func (*WeatherCondition) GetVisibility ¶
func (x *WeatherCondition) GetVisibility() int32
func (*WeatherCondition) GetWindChill ¶
func (x *WeatherCondition) GetWindChill() float32
func (*WeatherCondition) GetWindSpeed ¶
func (x *WeatherCondition) GetWindSpeed() int32
func (*WeatherCondition) ProtoMessage ¶
func (*WeatherCondition) ProtoMessage()
func (*WeatherCondition) ProtoReflect ¶
func (x *WeatherCondition) ProtoReflect() protoreflect.Message
func (*WeatherCondition) Reset ¶
func (x *WeatherCondition) Reset()
func (*WeatherCondition) String ¶
func (x *WeatherCondition) String() string
type WeatherForecast ¶
type WeatherForecast struct { ForecastedFor *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=forecasted_for,json=forecastedFor,proto3" json:"forecasted_for,omitempty"` ForecastId string `protobuf:"bytes,2,opt,name=forecast_id,json=forecastId,proto3" json:"forecast_id,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` Conditions *WeatherCondition `protobuf:"bytes,20,opt,name=conditions,proto3" json:"conditions,omitempty"` // contains filtered or unexported fields }
func (*WeatherForecast) Descriptor
deprecated
func (*WeatherForecast) Descriptor() ([]byte, []int)
Deprecated: Use WeatherForecast.ProtoReflect.Descriptor instead.
func (*WeatherForecast) GetConditions ¶
func (x *WeatherForecast) GetConditions() *WeatherCondition
func (*WeatherForecast) GetCreatedAt ¶
func (x *WeatherForecast) GetCreatedAt() *timestamppb.Timestamp
func (*WeatherForecast) GetForecastId ¶
func (x *WeatherForecast) GetForecastId() string
func (*WeatherForecast) GetForecastedFor ¶
func (x *WeatherForecast) GetForecastedFor() *timestamppb.Timestamp
func (*WeatherForecast) GetUpdatedAt ¶
func (x *WeatherForecast) GetUpdatedAt() *timestamppb.Timestamp
func (*WeatherForecast) ProtoMessage ¶
func (*WeatherForecast) ProtoMessage()
func (*WeatherForecast) ProtoReflect ¶
func (x *WeatherForecast) ProtoReflect() protoreflect.Message
func (*WeatherForecast) Reset ¶
func (x *WeatherForecast) Reset()
func (*WeatherForecast) String ¶
func (x *WeatherForecast) String() string
type WeatherIcon ¶
type WeatherIcon int32
const ( WeatherIcon_SUNNY WeatherIcon = 0 WeatherIcon_CLOUDY WeatherIcon = 1 WeatherIcon_PARTIALLY_CLOUDY WeatherIcon = 2 WeatherIcon_MOSTLY_CLOUDY WeatherIcon = 3 WeatherIcon_RAIN WeatherIcon = 4 WeatherIcon_CHANCE_OF_RAIN WeatherIcon = 5 WeatherIcon_SNOW WeatherIcon = 6 WeatherIcon_CHANCE_OF_SNOW WeatherIcon = 7 WeatherIcon_SNOW_SHOWERS WeatherIcon = 8 WeatherIcon_THUNDERSTORMS WeatherIcon = 9 WeatherIcon_FOG WeatherIcon = 10 )
func (WeatherIcon) Descriptor ¶
func (WeatherIcon) Descriptor() protoreflect.EnumDescriptor
func (WeatherIcon) Enum ¶
func (x WeatherIcon) Enum() *WeatherIcon
func (WeatherIcon) EnumDescriptor
deprecated
func (WeatherIcon) EnumDescriptor() ([]byte, []int)
Deprecated: Use WeatherIcon.Descriptor instead.
func (WeatherIcon) Number ¶
func (x WeatherIcon) Number() protoreflect.EnumNumber
func (WeatherIcon) String ¶
func (x WeatherIcon) String() string
func (WeatherIcon) Type ¶
func (WeatherIcon) Type() protoreflect.EnumType
type WeatherReport ¶
type WeatherReport struct { ObservedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=observed_at,json=observedAt,proto3" json:"observed_at,omitempty"` ObservationId string `protobuf:"bytes,2,opt,name=observation_id,json=observationId,proto3" json:"observation_id,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` Conditions *WeatherCondition `protobuf:"bytes,20,opt,name=conditions,proto3" json:"conditions,omitempty"` // contains filtered or unexported fields }
func (*WeatherReport) Descriptor
deprecated
func (*WeatherReport) Descriptor() ([]byte, []int)
Deprecated: Use WeatherReport.ProtoReflect.Descriptor instead.
func (*WeatherReport) GetConditions ¶
func (x *WeatherReport) GetConditions() *WeatherCondition
func (*WeatherReport) GetCreatedAt ¶
func (x *WeatherReport) GetCreatedAt() *timestamppb.Timestamp
func (*WeatherReport) GetObservationId ¶
func (x *WeatherReport) GetObservationId() string
func (*WeatherReport) GetObservedAt ¶
func (x *WeatherReport) GetObservedAt() *timestamppb.Timestamp
func (*WeatherReport) GetUpdatedAt ¶
func (x *WeatherReport) GetUpdatedAt() *timestamppb.Timestamp
func (*WeatherReport) ProtoMessage ¶
func (*WeatherReport) ProtoMessage()
func (*WeatherReport) ProtoReflect ¶
func (x *WeatherReport) ProtoReflect() protoreflect.Message
func (*WeatherReport) Reset ¶
func (x *WeatherReport) Reset()
func (*WeatherReport) String ¶
func (x *WeatherReport) String() string
type WeatherServiceClient ¶
type WeatherServiceClient interface { GetCurrentReport(ctx context.Context, in *GetCurrentReportRequest, opts ...grpc.CallOption) (*GetCurrentReportResponse, error) GetForecast(ctx context.Context, in *GetForecastRequest, opts ...grpc.CallOption) (*GetForecastResponse, 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 { GetCurrentReport(context.Context, *GetCurrentReportRequest) (*GetCurrentReportResponse, error) GetForecast(context.Context, *GetForecastRequest) (*GetForecastResponse, error) // contains filtered or unexported methods }
WeatherServiceServer is the server API for WeatherService service. All implementations must embed UnimplementedWeatherServiceServer for forward compatibility.