grpc

package
v0.0.0-...-ab9c376 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_grpc_OpenWeather_protobuf_open_weather_proto protoreflect.FileDescriptor
View Source
var OpenWeather_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "openweather.OpenWeather",
	HandlerType: (*OpenWeatherServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetTemperatureByLocation",
			Handler:    _OpenWeather_GetTemperatureByLocation_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "grpc_OpenWeather/protobuf/open_weather.proto",
}

OpenWeather_ServiceDesc is the grpc.ServiceDesc for OpenWeather service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterOpenWeatherServer

func RegisterOpenWeatherServer(s grpc.ServiceRegistrar, srv OpenWeatherServer)

Types

type Location

type Location struct {
	Location string `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"` // The Location
	// contains filtered or unexported fields
}

A feature names something at a given point.

If a feature could not be named, the name is empty.

func (*Location) Descriptor deprecated

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

Deprecated: Use Location.ProtoReflect.Descriptor instead.

func (*Location) GetLocation

func (x *Location) GetLocation() string

func (*Location) ProtoMessage

func (*Location) ProtoMessage()

func (*Location) ProtoReflect

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

func (*Location) Reset

func (x *Location) Reset()

func (*Location) String

func (x *Location) String() string

type OpenWeatherClient

type OpenWeatherClient interface {
	// A simple RPC.
	//
	// Obtains the current location
	//
	// A feature with an empty name is returned if there's no feature at the given
	// position.
	GetTemperatureByLocation(ctx context.Context, in *Location, opts ...grpc.CallOption) (*Temperature, error)
}

OpenWeatherClient is the client API for OpenWeather 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 OpenWeatherServer

type OpenWeatherServer interface {
	// A simple RPC.
	//
	// Obtains the current location
	//
	// A feature with an empty name is returned if there's no feature at the given
	// position.
	GetTemperatureByLocation(context.Context, *Location) (*Temperature, error)
	// contains filtered or unexported methods
}

OpenWeatherServer is the server API for OpenWeather service. All implementations must embed UnimplementedOpenWeatherServer for forward compatibility

type Temperature

type Temperature struct {
	Location  string  `protobuf:"bytes,1,opt,name=Location,proto3" json:"Location,omitempty"`
	Temp      float64 `protobuf:"fixed64,2,opt,name=Temp,proto3" json:"Temp,omitempty"`                      // current Temperature
	TempMin   float64 `protobuf:"fixed64,3,opt,name=Temp_min,json=TempMin,proto3" json:"Temp_min,omitempty"` // lowest Temperatures
	TempMax   float64 `protobuf:"fixed64,4,opt,name=Temp_max,json=TempMax,proto3" json:"Temp_max,omitempty"` // higest Temperatures
	TimeStamp int64   `protobuf:"varint,5,opt,name=TimeStamp,proto3" json:"TimeStamp,omitempty"`
	// contains filtered or unexported fields
}

Points are represented as latitude-longitude pairs in the E7 representation (degrees multiplied by 10**7 and rounded to the nearest integer). Latitudes should be in the range +/- 90 degrees and longitude should be in the range +/- 180 degrees (inclusive).

func (*Temperature) Descriptor deprecated

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

Deprecated: Use Temperature.ProtoReflect.Descriptor instead.

func (*Temperature) GetLocation

func (x *Temperature) GetLocation() string

func (*Temperature) GetTemp

func (x *Temperature) GetTemp() float64

func (*Temperature) GetTempMax

func (x *Temperature) GetTempMax() float64

func (*Temperature) GetTempMin

func (x *Temperature) GetTempMin() float64

func (*Temperature) GetTimeStamp

func (x *Temperature) GetTimeStamp() int64

func (*Temperature) ProtoMessage

func (*Temperature) ProtoMessage()

func (*Temperature) ProtoReflect

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

func (*Temperature) Reset

func (x *Temperature) Reset()

func (*Temperature) String

func (x *Temperature) String() string

type UnimplementedOpenWeatherServer

type UnimplementedOpenWeatherServer struct {
}

UnimplementedOpenWeatherServer must be embedded to have forward compatible implementations.

func (UnimplementedOpenWeatherServer) GetTemperatureByLocation

func (UnimplementedOpenWeatherServer) GetTemperatureByLocation(context.Context, *Location) (*Temperature, error)

type UnsafeOpenWeatherServer

type UnsafeOpenWeatherServer interface {
	// contains filtered or unexported methods
}

UnsafeOpenWeatherServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OpenWeatherServer will result in compilation errors.

Jump to

Keyboard shortcuts

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