Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error
- func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type GetLocationByIPRequest
- func (*GetLocationByIPRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetLocationByIPRequest) GetIp() string
- func (*GetLocationByIPRequest) ProtoMessage()
- func (x *GetLocationByIPRequest) ProtoReflect() protoreflect.Message
- func (x *GetLocationByIPRequest) Reset()
- func (x *GetLocationByIPRequest) String() string
- type GetLocationByIPResponse
- func (*GetLocationByIPResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetLocationByIPResponse) GetLocation() *Location
- func (*GetLocationByIPResponse) ProtoMessage()
- func (x *GetLocationByIPResponse) ProtoReflect() protoreflect.Message
- func (x *GetLocationByIPResponse) Reset()
- func (x *GetLocationByIPResponse) String() string
- type Location
- type ServiceClient
- type ServiceServer
- type UnimplementedServiceServer
- type UnsafeServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_standort_v1_service_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "standort.v1.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetLocationByIP", Handler: _Service_GetLocationByIP_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 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) GetContinent ¶
func (*Location) GetCountry ¶
func (*Location) ProtoMessage ¶
func (*Location) ProtoMessage()
func (*Location) ProtoReflect ¶
func (x *Location) ProtoReflect() protoreflect.Message
type ServiceClient ¶
type ServiceClient interface { // GetLocationByIP for an IP address. GetLocationByIP(ctx context.Context, in *GetLocationByIPRequest, opts ...grpc.CallOption) (*GetLocationByIPResponse, error) }
ServiceClient is the client API for Service 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 NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface { // GetLocationByIP for an IP address. GetLocationByIP(context.Context, *GetLocationByIPRequest) (*GetLocationByIPResponse, 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) GetLocationByIP(context.Context, *GetLocationByIPRequest) (*GetLocationByIPResponse, error)
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.