v1

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: Unlicense Imports: 16 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_standort_v1_service_proto protoreflect.FileDescriptor
View Source
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "standort.v1.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetLocationByIP",
			Handler:    _Service_GetLocationByIP_Handler,
		},
		{
			MethodName: "GetLocationByLatLng",
			Handler:    _Service_GetLocationByLatLng_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "standort/v1/service.proto",
}

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

Functions

func RegisterServiceHandler

func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterServiceHandler registers the http handlers for service Service to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterServiceHandlerClient

func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error

RegisterServiceHandlerClient registers the http handlers for service Service to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ServiceClient" to call the correct interceptors.

func RegisterServiceHandlerFromEndpoint

func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterServiceHandlerFromEndpoint is same as RegisterServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterServiceHandlerServer

func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error

RegisterServiceHandlerServer registers the http handlers for service Service to "mux". UnaryRPC :call ServiceServer 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 RegisterServiceHandlerFromEndpoint instead.

func RegisterServiceServer

func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)

Types

type GetLocationByIPRequest

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

GetLocationByIPRequest for an IP address.

func (*GetLocationByIPRequest) Descriptor deprecated

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

Deprecated: Use GetLocationByIPRequest.ProtoReflect.Descriptor instead.

func (*GetLocationByIPRequest) GetIp

func (x *GetLocationByIPRequest) GetIp() string

func (*GetLocationByIPRequest) ProtoMessage

func (*GetLocationByIPRequest) ProtoMessage()

func (*GetLocationByIPRequest) ProtoReflect

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

func (*GetLocationByIPRequest) Reset

func (x *GetLocationByIPRequest) Reset()

func (*GetLocationByIPRequest) String

func (x *GetLocationByIPRequest) String() string

type GetLocationByIPResponse

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

GetLocationByIPResponse for an IP address.

func (*GetLocationByIPResponse) Descriptor deprecated

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

Deprecated: Use GetLocationByIPResponse.ProtoReflect.Descriptor instead.

func (*GetLocationByIPResponse) GetLocation

func (x *GetLocationByIPResponse) GetLocation() *Location

func (*GetLocationByIPResponse) ProtoMessage

func (*GetLocationByIPResponse) ProtoMessage()

func (*GetLocationByIPResponse) ProtoReflect

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

func (*GetLocationByIPResponse) Reset

func (x *GetLocationByIPResponse) Reset()

func (*GetLocationByIPResponse) String

func (x *GetLocationByIPResponse) String() string

type GetLocationByLatLngRequest added in v1.4.0

type GetLocationByLatLngRequest struct {
	Lat float64 `protobuf:"fixed64,1,opt,name=lat,proto3" json:"lat,omitempty"`
	Lng float64 `protobuf:"fixed64,2,opt,name=lng,proto3" json:"lng,omitempty"`
	// contains filtered or unexported fields
}

GetLocationByLatLngRequest for a latitude and longitude.

func (*GetLocationByLatLngRequest) Descriptor deprecated added in v1.4.0

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

Deprecated: Use GetLocationByLatLngRequest.ProtoReflect.Descriptor instead.

func (*GetLocationByLatLngRequest) GetLat added in v1.4.0

func (x *GetLocationByLatLngRequest) GetLat() float64

func (*GetLocationByLatLngRequest) GetLng added in v1.4.0

func (x *GetLocationByLatLngRequest) GetLng() float64

func (*GetLocationByLatLngRequest) ProtoMessage added in v1.4.0

func (*GetLocationByLatLngRequest) ProtoMessage()

func (*GetLocationByLatLngRequest) ProtoReflect added in v1.4.0

func (*GetLocationByLatLngRequest) Reset added in v1.4.0

func (x *GetLocationByLatLngRequest) Reset()

func (*GetLocationByLatLngRequest) String added in v1.4.0

func (x *GetLocationByLatLngRequest) String() string

type GetLocationByLatLngResponse added in v1.4.0

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

GetLocationByLatLngResponse for a latitude and longitude.

func (*GetLocationByLatLngResponse) Descriptor deprecated added in v1.4.0

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

Deprecated: Use GetLocationByLatLngResponse.ProtoReflect.Descriptor instead.

func (*GetLocationByLatLngResponse) GetLocation added in v1.4.0

func (x *GetLocationByLatLngResponse) GetLocation() *Location

func (*GetLocationByLatLngResponse) ProtoMessage added in v1.4.0

func (*GetLocationByLatLngResponse) ProtoMessage()

func (*GetLocationByLatLngResponse) ProtoReflect added in v1.4.0

func (*GetLocationByLatLngResponse) Reset added in v1.4.0

func (x *GetLocationByLatLngResponse) Reset()

func (*GetLocationByLatLngResponse) String added in v1.4.0

func (x *GetLocationByLatLngResponse) String() string

type Location

type Location struct {
	Country   string `protobuf:"bytes,1,opt,name=country,proto3" json:"country,omitempty"`
	Continent string `protobuf:"bytes,2,opt,name=continent,proto3" json:"continent,omitempty"`
	// contains filtered or unexported fields
}

Location of the response.

func (*Location) Descriptor deprecated

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

Deprecated: Use Location.ProtoReflect.Descriptor instead.

func (*Location) GetContinent

func (x *Location) GetContinent() string

func (*Location) GetCountry

func (x *Location) GetCountry() 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 ServiceClient

type ServiceClient interface {
	// GetLocationByIP for an IP address.
	GetLocationByIP(ctx context.Context, in *GetLocationByIPRequest, opts ...grpc.CallOption) (*GetLocationByIPResponse, error)
	// GetLocationByLatLng for a latitude and longitude.
	GetLocationByLatLng(ctx context.Context, in *GetLocationByLatLngRequest, opts ...grpc.CallOption) (*GetLocationByLatLngResponse, error)
}

ServiceClient is the client API for Service service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.golang.ir/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewServiceClient

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceServer

type ServiceServer interface {
	// GetLocationByIP for an IP address.
	GetLocationByIP(context.Context, *GetLocationByIPRequest) (*GetLocationByIPResponse, error)
	// GetLocationByLatLng for a latitude and longitude.
	GetLocationByLatLng(context.Context, *GetLocationByLatLngRequest) (*GetLocationByLatLngResponse, error)
	// contains filtered or unexported methods
}

ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedServiceServer) GetLocationByIP

func (UnimplementedServiceServer) GetLocationByLatLng added in v1.4.0

type UnsafeServiceServer

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

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

Jump to

Keyboard shortcuts

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