ip

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_ip_proto protoreflect.FileDescriptor

Functions

func NewIpEndpoints

func NewIpEndpoints() []*api.Endpoint

func RegisterIpHandler

func RegisterIpHandler(s server.Server, hdlr IpHandler, opts ...server.HandlerOption) error

Types

type IpHandler

type IpHandler interface {
	Lookup(context.Context, *LookupRequest, *LookupResponse) error
}

type IpService

type IpService interface {
	Lookup(ctx context.Context, in *LookupRequest, opts ...client.CallOption) (*LookupResponse, error)
}

func NewIpService

func NewIpService(name string, c client.Client) IpService

type LookupRequest

type LookupRequest struct {

	// IP to lookup
	Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
	// contains filtered or unexported fields
}

Lookup the geolocation information for an IP address

func (*LookupRequest) Descriptor deprecated

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

Deprecated: Use LookupRequest.ProtoReflect.Descriptor instead.

func (*LookupRequest) GetIp

func (x *LookupRequest) GetIp() string

func (*LookupRequest) ProtoMessage

func (*LookupRequest) ProtoMessage()

func (*LookupRequest) ProtoReflect

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

func (*LookupRequest) Reset

func (x *LookupRequest) Reset()

func (*LookupRequest) String

func (x *LookupRequest) String() string

type LookupResponse

type LookupResponse struct {

	// IP of the query
	Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
	// Autonomous system number
	Asn int32 `protobuf:"varint,2,opt,name=asn,proto3" json:"asn,omitempty"`
	// Name of the city
	City string `protobuf:"bytes,3,opt,name=city,proto3" json:"city,omitempty"`
	// Name of the country
	Country string `protobuf:"bytes,4,opt,name=country,proto3" json:"country,omitempty"`
	// Name of the continent
	Continent string `protobuf:"bytes,5,opt,name=continent,proto3" json:"continent,omitempty"`
	// Latitude e.g 52.523219
	Latitude float64 `protobuf:"fixed64,6,opt,name=latitude,proto3" json:"latitude,omitempty"`
	// Longitude e.g 13.428555
	Longitude float64 `protobuf:"fixed64,7,opt,name=longitude,proto3" json:"longitude,omitempty"`
	// Timezone e.g Europe/Rome
	Timezone string `protobuf:"bytes,8,opt,name=timezone,proto3" json:"timezone,omitempty"`
	// contains filtered or unexported fields
}

func (*LookupResponse) Descriptor deprecated

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

Deprecated: Use LookupResponse.ProtoReflect.Descriptor instead.

func (*LookupResponse) GetAsn

func (x *LookupResponse) GetAsn() int32

func (*LookupResponse) GetCity

func (x *LookupResponse) GetCity() string

func (*LookupResponse) GetContinent

func (x *LookupResponse) GetContinent() string

func (*LookupResponse) GetCountry

func (x *LookupResponse) GetCountry() string

func (*LookupResponse) GetIp

func (x *LookupResponse) GetIp() string

func (*LookupResponse) GetLatitude

func (x *LookupResponse) GetLatitude() float64

func (*LookupResponse) GetLongitude

func (x *LookupResponse) GetLongitude() float64

func (*LookupResponse) GetTimezone

func (x *LookupResponse) GetTimezone() string

func (*LookupResponse) ProtoMessage

func (*LookupResponse) ProtoMessage()

func (*LookupResponse) ProtoReflect

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

func (*LookupResponse) Reset

func (x *LookupResponse) Reset()

func (*LookupResponse) String

func (x *LookupResponse) String() string

Jump to

Keyboard shortcuts

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