location_weather

package
v0.0.0-...-243534e Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package location_weather is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	WeatherService_GetLocationById_FullMethodName = "/location_weather.WeatherService/GetLocationById"
)

Variables

View Source
var File_location_weather_proto protoreflect.FileDescriptor
View Source
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

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.

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.

Jump to

Keyboard shortcuts

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