Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterIpInfoServer(s grpc.ServiceRegistrar, srv IpInfoServer)
- type Ip
- type IpInfoClient
- type IpInfoServer
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetCity() string
- func (x *Response) GetContinent() string
- func (x *Response) GetCountry() string
- func (x *Response) GetIp() string
- func (x *Response) GetLatitude() float64
- func (x *Response) GetLongitude() float64
- func (x *Response) GetStateProv() string
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) String() string
- type UnimplementedIpInfoServer
- type UnsafeIpInfoServer
Constants ¶
const ( IpInfo_GetIpInfo_FullMethodName = "/IpInfo/GetIpInfo" IpInfo_GetClientIp_FullMethodName = "/IpInfo/GetClientIp" )
Variables ¶
var File_api_proto_ip_info_proto protoreflect.FileDescriptor
var IpInfo_ServiceDesc = grpc.ServiceDesc{ ServiceName: "IpInfo", HandlerType: (*IpInfoServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetIpInfo", Handler: _IpInfo_GetIpInfo_Handler, }, { MethodName: "GetClientIp", Handler: _IpInfo_GetClientIp_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/proto/ip_info.proto", }
IpInfo_ServiceDesc is the grpc.ServiceDesc for IpInfo service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterIpInfoServer ¶
func RegisterIpInfoServer(s grpc.ServiceRegistrar, srv IpInfoServer)
Types ¶
type Ip ¶
type Ip struct { Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` // contains filtered or unexported fields }
func (*Ip) Descriptor
deprecated
func (*Ip) ProtoMessage ¶
func (*Ip) ProtoMessage()
func (*Ip) ProtoReflect ¶
func (x *Ip) ProtoReflect() protoreflect.Message
type IpInfoClient ¶
type IpInfoClient interface { GetIpInfo(ctx context.Context, in *Ip, opts ...grpc.CallOption) (*Response, error) GetClientIp(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Response, error) }
IpInfoClient is the client API for IpInfo 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 NewIpInfoClient ¶
func NewIpInfoClient(cc grpc.ClientConnInterface) IpInfoClient
type IpInfoServer ¶
type IpInfoServer interface { GetIpInfo(context.Context, *Ip) (*Response, error) GetClientIp(context.Context, *emptypb.Empty) (*Response, error) // contains filtered or unexported methods }
IpInfoServer is the server API for IpInfo service. All implementations must embed UnimplementedIpInfoServer for forward compatibility.
type Response ¶
type Response struct { Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` Continent string `protobuf:"bytes,2,opt,name=continent,proto3" json:"continent,omitempty"` Country string `protobuf:"bytes,3,opt,name=country,proto3" json:"country,omitempty"` StateProv string `protobuf:"bytes,4,opt,name=state_prov,json=stateProv,proto3" json:"state_prov,omitempty"` City string `protobuf:"bytes,5,opt,name=city,proto3" json:"city,omitempty"` Latitude float64 `protobuf:"fixed64,6,opt,name=latitude,proto3" json:"latitude,omitempty"` Longitude float64 `protobuf:"fixed64,7,opt,name=longitude,proto3" json:"longitude,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetContinent ¶
func (*Response) GetCountry ¶
func (*Response) GetLatitude ¶
func (*Response) GetLongitude ¶
func (*Response) GetStateProv ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type UnimplementedIpInfoServer ¶
type UnimplementedIpInfoServer struct{}
UnimplementedIpInfoServer 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 (UnimplementedIpInfoServer) GetClientIp ¶
type UnsafeIpInfoServer ¶
type UnsafeIpInfoServer interface {
// contains filtered or unexported methods
}
UnsafeIpInfoServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IpInfoServer will result in compilation errors.