v1

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IpInfo_GetIpInfo_FullMethodName   = "/IpInfo/GetIpInfo"
	IpInfo_GetClientIp_FullMethodName = "/IpInfo/GetClientIp"
)

Variables

View Source
var File_api_proto_ip_info_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Ip.ProtoReflect.Descriptor instead.

func (*Ip) GetIp

func (x *Ip) GetIp() string

func (*Ip) ProtoMessage

func (*Ip) ProtoMessage()

func (*Ip) ProtoReflect

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

func (*Ip) Reset

func (x *Ip) Reset()

func (*Ip) String

func (x *Ip) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetCity

func (x *Response) GetCity() string

func (*Response) GetContinent

func (x *Response) GetContinent() string

func (*Response) GetCountry

func (x *Response) GetCountry() string

func (*Response) GetIp

func (x *Response) GetIp() string

func (*Response) GetLatitude

func (x *Response) GetLatitude() float64

func (*Response) GetLongitude

func (x *Response) GetLongitude() float64

func (*Response) GetStateProv

func (x *Response) GetStateProv() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

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

func (UnimplementedIpInfoServer) GetIpInfo

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.

Jump to

Keyboard shortcuts

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