weather

package
v0.25.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_weather_proto protoreflect.FileDescriptor

Functions

func NewWeatherEndpoints

func NewWeatherEndpoints() []*api.Endpoint

func RegisterWeatherHandler

func RegisterWeatherHandler(s server.Server, hdlr WeatherHandler, opts ...server.HandlerOption) error

Types

type Forecast

type Forecast struct {

	// date of the forecast
	Date string `protobuf:"bytes,1,opt,name=date,proto3" json:"date,omitempty"`
	// max temp in celsius
	MaxTempC float64 `protobuf:"fixed64,2,opt,name=max_temp_c,json=maxTempC,proto3" json:"max_temp_c,omitempty"`
	// max temp in fahrenheit
	MaxTempF float64 `protobuf:"fixed64,3,opt,name=max_temp_f,json=maxTempF,proto3" json:"max_temp_f,omitempty"`
	// minimum temp in celsius
	MinTempC float64 `protobuf:"fixed64,4,opt,name=min_temp_c,json=minTempC,proto3" json:"min_temp_c,omitempty"`
	// minimum temp in fahrenheit
	MinTempF float64 `protobuf:"fixed64,5,opt,name=min_temp_f,json=minTempF,proto3" json:"min_temp_f,omitempty"`
	// the average temp in celsius
	AvgTempC float64 `protobuf:"fixed64,6,opt,name=avg_temp_c,json=avgTempC,proto3" json:"avg_temp_c,omitempty"`
	// the average temp in fahrenheit
	AvgTempF float64 `protobuf:"fixed64,7,opt,name=avg_temp_f,json=avgTempF,proto3" json:"avg_temp_f,omitempty"`
	// will it rain
	WillItRain bool `protobuf:"varint,8,opt,name=will_it_rain,json=willItRain,proto3" json:"will_it_rain,omitempty"`
	// chance of rain (percentage)
	ChanceOfRain int32 `protobuf:"varint,9,opt,name=chance_of_rain,json=chanceOfRain,proto3" json:"chance_of_rain,omitempty"`
	// forecast condition
	Condition string `protobuf:"bytes,10,opt,name=condition,proto3" json:"condition,omitempty"`
	// the URL of forecast condition icon. Simply prefix with either http or https to use it
	IconUrl string `protobuf:"bytes,11,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"`
	// time of sunrise
	Sunrise string `protobuf:"bytes,12,opt,name=sunrise,proto3" json:"sunrise,omitempty"`
	// time of sunset
	Sunset string `protobuf:"bytes,13,opt,name=sunset,proto3" json:"sunset,omitempty"`
	// contains filtered or unexported fields
}

func (*Forecast) Descriptor deprecated

func (*Forecast) Descriptor() ([]byte, []int)

Deprecated: Use Forecast.ProtoReflect.Descriptor instead.

func (*Forecast) GetAvgTempC

func (x *Forecast) GetAvgTempC() float64

func (*Forecast) GetAvgTempF

func (x *Forecast) GetAvgTempF() float64

func (*Forecast) GetChanceOfRain

func (x *Forecast) GetChanceOfRain() int32

func (*Forecast) GetCondition

func (x *Forecast) GetCondition() string

func (*Forecast) GetDate

func (x *Forecast) GetDate() string

func (*Forecast) GetIconUrl

func (x *Forecast) GetIconUrl() string

func (*Forecast) GetMaxTempC

func (x *Forecast) GetMaxTempC() float64

func (*Forecast) GetMaxTempF

func (x *Forecast) GetMaxTempF() float64

func (*Forecast) GetMinTempC

func (x *Forecast) GetMinTempC() float64

func (*Forecast) GetMinTempF

func (x *Forecast) GetMinTempF() float64

func (*Forecast) GetSunrise

func (x *Forecast) GetSunrise() string

func (*Forecast) GetSunset

func (x *Forecast) GetSunset() string

func (*Forecast) GetWillItRain

func (x *Forecast) GetWillItRain() bool

func (*Forecast) ProtoMessage

func (*Forecast) ProtoMessage()

func (*Forecast) ProtoReflect

func (x *Forecast) ProtoReflect() protoreflect.Message

func (*Forecast) Reset

func (x *Forecast) Reset()

func (*Forecast) String

func (x *Forecast) String() string

type ForecastRequest

type ForecastRequest struct {

	// location of the forecase
	Location string `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"`
	// number of days. default 1, max 10
	Days int32 `protobuf:"varint,2,opt,name=days,proto3" json:"days,omitempty"`
	// contains filtered or unexported fields
}

Get the weather forecast for the next 1-10 days

func (*ForecastRequest) Descriptor deprecated

func (*ForecastRequest) Descriptor() ([]byte, []int)

Deprecated: Use ForecastRequest.ProtoReflect.Descriptor instead.

func (*ForecastRequest) GetDays

func (x *ForecastRequest) GetDays() int32

func (*ForecastRequest) GetLocation

func (x *ForecastRequest) GetLocation() string

func (*ForecastRequest) ProtoMessage

func (*ForecastRequest) ProtoMessage()

func (*ForecastRequest) ProtoReflect

func (x *ForecastRequest) ProtoReflect() protoreflect.Message

func (*ForecastRequest) Reset

func (x *ForecastRequest) Reset()

func (*ForecastRequest) String

func (x *ForecastRequest) String() string

type ForecastResponse

type ForecastResponse struct {

	// location of the request
	Location string `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"`
	// region related to the location
	Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
	// country of the request
	Country string `protobuf:"bytes,3,opt,name=country,proto3" json:"country,omitempty"`
	// e.g 37.55
	Latitude float64 `protobuf:"fixed64,4,opt,name=latitude,proto3" json:"latitude,omitempty"`
	// e.g -77.46
	Longitude float64 `protobuf:"fixed64,5,opt,name=longitude,proto3" json:"longitude,omitempty"`
	// timezone of the location
	Timezone string `protobuf:"bytes,6,opt,name=timezone,proto3" json:"timezone,omitempty"`
	// the local time
	LocalTime string `protobuf:"bytes,7,opt,name=local_time,json=localTime,proto3" json:"local_time,omitempty"`
	// forecast for the next number of days
	Forecast []*Forecast `protobuf:"bytes,8,rep,name=forecast,proto3" json:"forecast,omitempty"`
	// contains filtered or unexported fields
}

func (*ForecastResponse) Descriptor deprecated

func (*ForecastResponse) Descriptor() ([]byte, []int)

Deprecated: Use ForecastResponse.ProtoReflect.Descriptor instead.

func (*ForecastResponse) GetCountry

func (x *ForecastResponse) GetCountry() string

func (*ForecastResponse) GetForecast

func (x *ForecastResponse) GetForecast() []*Forecast

func (*ForecastResponse) GetLatitude

func (x *ForecastResponse) GetLatitude() float64

func (*ForecastResponse) GetLocalTime

func (x *ForecastResponse) GetLocalTime() string

func (*ForecastResponse) GetLocation

func (x *ForecastResponse) GetLocation() string

func (*ForecastResponse) GetLongitude

func (x *ForecastResponse) GetLongitude() float64

func (*ForecastResponse) GetRegion

func (x *ForecastResponse) GetRegion() string

func (*ForecastResponse) GetTimezone

func (x *ForecastResponse) GetTimezone() string

func (*ForecastResponse) ProtoMessage

func (*ForecastResponse) ProtoMessage()

func (*ForecastResponse) ProtoReflect

func (x *ForecastResponse) ProtoReflect() protoreflect.Message

func (*ForecastResponse) Reset

func (x *ForecastResponse) Reset()

func (*ForecastResponse) String

func (x *ForecastResponse) String() string

type NowRequest

type NowRequest struct {

	// location to get weather e.g postcode, city
	Location string `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"`
	// contains filtered or unexported fields
}

Get the current weather report for a location by postcode, city, zip code, ip address

func (*NowRequest) Descriptor deprecated

func (*NowRequest) Descriptor() ([]byte, []int)

Deprecated: Use NowRequest.ProtoReflect.Descriptor instead.

func (*NowRequest) GetLocation

func (x *NowRequest) GetLocation() string

func (*NowRequest) ProtoMessage

func (*NowRequest) ProtoMessage()

func (*NowRequest) ProtoReflect

func (x *NowRequest) ProtoReflect() protoreflect.Message

func (*NowRequest) Reset

func (x *NowRequest) Reset()

func (*NowRequest) String

func (x *NowRequest) String() string

type NowResponse

type NowResponse struct {

	// location of the request
	Location string `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"`
	// region related to the location
	Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
	// country of the request
	Country string `protobuf:"bytes,3,opt,name=country,proto3" json:"country,omitempty"`
	// e.g 37.55
	Latitude float64 `protobuf:"fixed64,4,opt,name=latitude,proto3" json:"latitude,omitempty"`
	// e.g -77.46
	Longitude float64 `protobuf:"fixed64,5,opt,name=longitude,proto3" json:"longitude,omitempty"`
	// timezone of the location
	Timezone string `protobuf:"bytes,6,opt,name=timezone,proto3" json:"timezone,omitempty"`
	// the local time
	LocalTime string `protobuf:"bytes,7,opt,name=local_time,json=localTime,proto3" json:"local_time,omitempty"`
	// temperature in celsius
	TempC float64 `protobuf:"fixed64,8,opt,name=temp_c,json=tempC,proto3" json:"temp_c,omitempty"`
	// temperature in fahrenheit
	TempF float64 `protobuf:"fixed64,9,opt,name=temp_f,json=tempF,proto3" json:"temp_f,omitempty"`
	// feels like in celsius
	FeelsLikeC float64 `protobuf:"fixed64,10,opt,name=feels_like_c,json=feelsLikeC,proto3" json:"feels_like_c,omitempty"`
	// feels like in fahrenheit
	FeelsLikeF float64 `protobuf:"fixed64,11,opt,name=feels_like_f,json=feelsLikeF,proto3" json:"feels_like_f,omitempty"`
	// the humidity percentage
	Humidity int32 `protobuf:"varint,12,opt,name=humidity,proto3" json:"humidity,omitempty"`
	// cloud cover percentage
	Cloud int32 `protobuf:"varint,13,opt,name=cloud,proto3" json:"cloud,omitempty"`
	// whether its daytime
	Daytime bool `protobuf:"varint,14,opt,name=daytime,proto3" json:"daytime,omitempty"`
	// the weather condition
	Condition string `protobuf:"bytes,15,opt,name=condition,proto3" json:"condition,omitempty"`
	// the URL of the related icon. Simply prefix with either http or https to use it
	IconUrl string `protobuf:"bytes,16,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"`
	// wind in mph
	WindMph float64 `protobuf:"fixed64,17,opt,name=wind_mph,json=windMph,proto3" json:"wind_mph,omitempty"`
	// wind in kph
	WindKph float64 `protobuf:"fixed64,18,opt,name=wind_kph,json=windKph,proto3" json:"wind_kph,omitempty"`
	// wind direction
	WindDirection string `protobuf:"bytes,19,opt,name=wind_direction,json=windDirection,proto3" json:"wind_direction,omitempty"`
	// wind degree
	WindDegree int32 `protobuf:"varint,20,opt,name=wind_degree,json=windDegree,proto3" json:"wind_degree,omitempty"`
	// contains filtered or unexported fields
}

func (*NowResponse) Descriptor deprecated

func (*NowResponse) Descriptor() ([]byte, []int)

Deprecated: Use NowResponse.ProtoReflect.Descriptor instead.

func (*NowResponse) GetCloud

func (x *NowResponse) GetCloud() int32

func (*NowResponse) GetCondition

func (x *NowResponse) GetCondition() string

func (*NowResponse) GetCountry

func (x *NowResponse) GetCountry() string

func (*NowResponse) GetDaytime

func (x *NowResponse) GetDaytime() bool

func (*NowResponse) GetFeelsLikeC

func (x *NowResponse) GetFeelsLikeC() float64

func (*NowResponse) GetFeelsLikeF

func (x *NowResponse) GetFeelsLikeF() float64

func (*NowResponse) GetHumidity

func (x *NowResponse) GetHumidity() int32

func (*NowResponse) GetIconUrl

func (x *NowResponse) GetIconUrl() string

func (*NowResponse) GetLatitude

func (x *NowResponse) GetLatitude() float64

func (*NowResponse) GetLocalTime

func (x *NowResponse) GetLocalTime() string

func (*NowResponse) GetLocation

func (x *NowResponse) GetLocation() string

func (*NowResponse) GetLongitude

func (x *NowResponse) GetLongitude() float64

func (*NowResponse) GetRegion

func (x *NowResponse) GetRegion() string

func (*NowResponse) GetTempC

func (x *NowResponse) GetTempC() float64

func (*NowResponse) GetTempF

func (x *NowResponse) GetTempF() float64

func (*NowResponse) GetTimezone

func (x *NowResponse) GetTimezone() string

func (*NowResponse) GetWindDegree

func (x *NowResponse) GetWindDegree() int32

func (*NowResponse) GetWindDirection

func (x *NowResponse) GetWindDirection() string

func (*NowResponse) GetWindKph

func (x *NowResponse) GetWindKph() float64

func (*NowResponse) GetWindMph

func (x *NowResponse) GetWindMph() float64

func (*NowResponse) ProtoMessage

func (*NowResponse) ProtoMessage()

func (*NowResponse) ProtoReflect

func (x *NowResponse) ProtoReflect() protoreflect.Message

func (*NowResponse) Reset

func (x *NowResponse) Reset()

func (*NowResponse) String

func (x *NowResponse) String() string

type WeatherHandler

type WeatherHandler interface {
	Now(context.Context, *NowRequest, *NowResponse) error
	Forecast(context.Context, *ForecastRequest, *ForecastResponse) error
}

type WeatherService

type WeatherService interface {
	Now(ctx context.Context, in *NowRequest, opts ...client.CallOption) (*NowResponse, error)
	Forecast(ctx context.Context, in *ForecastRequest, opts ...client.CallOption) (*ForecastResponse, error)
}

func NewWeatherService

func NewWeatherService(name string, c client.Client) WeatherService

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL