geoip

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, options *GeoIPOptions) (db *geoip2.Reader, err error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (Client) City

func (c Client) City(ip net.IP) (string, error)

func (Client) GeoCity

func (c Client) GeoCity(ip net.IP) (*geoip2.City, error)

func (Client) Marshal

func (c Client) Marshal() ([]byte, error)

func (Client) MarshalJSON

func (c Client) MarshalJSON() ([]byte, error)

func (*Client) Merge

func (c *Client) Merge(src proto.Message)

Merge implement proto.Merger

func (*Client) ProtoMessage

func (c *Client) ProtoMessage()

ProtoMessage implement proto.Message

func (*Client) Reset

func (c *Client) Reset()

Reset *implement proto.Message*

func (Client) String

func (c Client) String() string

String implement proto.Message

func (*Client) Unmarshal

func (c *Client) Unmarshal(data []byte) (err error)

func (*Client) UnmarshalJSON

func (c *Client) UnmarshalJSON(data []byte) (err error)

type CustomGeoOptions

type CustomGeoOptions struct {
	Name                 string                                  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Subnets              github_com_MicroOps_cn_fuck_sets.IPNets `protobuf:"bytes,2,opt,name=subnets,proto3,customtype=github.com/MicroOps-cn/fuck/sets.IPNets" json:"subnets"`
	XXX_NoUnkeyedLiteral struct{}                                `json:"-"`
	XXX_unrecognized     []byte                                  `json:"-"`
	XXX_sizecache        int32                                   `json:"-"`
}

func (*CustomGeoOptions) Descriptor

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

func (*CustomGeoOptions) GetName

func (m *CustomGeoOptions) GetName() string

func (*CustomGeoOptions) ProtoMessage

func (*CustomGeoOptions) ProtoMessage()

func (*CustomGeoOptions) Reset

func (m *CustomGeoOptions) Reset()

func (*CustomGeoOptions) String

func (m *CustomGeoOptions) String() string

func (*CustomGeoOptions) XXX_DiscardUnknown

func (m *CustomGeoOptions) XXX_DiscardUnknown()

func (*CustomGeoOptions) XXX_Marshal

func (m *CustomGeoOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CustomGeoOptions) XXX_Merge

func (m *CustomGeoOptions) XXX_Merge(src proto.Message)

func (*CustomGeoOptions) XXX_Size

func (m *CustomGeoOptions) XXX_Size() int

func (*CustomGeoOptions) XXX_Unmarshal

func (m *CustomGeoOptions) XXX_Unmarshal(b []byte) error

type Duration

type Duration = types.Duration

Duration from public import google/protobuf/duration.proto

type GeoIPOptions

type GeoIPOptions struct {
	Path                 string              `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	Custom               []*CustomGeoOptions `protobuf:"bytes,2,rep,name=custom,proto3" json:"custom,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

func NewGeoIPOptions

func NewGeoIPOptions() *GeoIPOptions

func (*GeoIPOptions) Descriptor

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

func (*GeoIPOptions) GetCustom

func (m *GeoIPOptions) GetCustom() []*CustomGeoOptions

func (*GeoIPOptions) GetPath

func (m *GeoIPOptions) GetPath() string

func (*GeoIPOptions) ProtoMessage

func (*GeoIPOptions) ProtoMessage()

func (*GeoIPOptions) Reset

func (m *GeoIPOptions) Reset()

func (*GeoIPOptions) String

func (m *GeoIPOptions) String() string

func (*GeoIPOptions) XXX_DiscardUnknown

func (m *GeoIPOptions) XXX_DiscardUnknown()

func (*GeoIPOptions) XXX_Marshal

func (m *GeoIPOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GeoIPOptions) XXX_Merge

func (m *GeoIPOptions) XXX_Merge(src proto.Message)

func (*GeoIPOptions) XXX_Size

func (m *GeoIPOptions) XXX_Size() int

func (*GeoIPOptions) XXX_Unmarshal

func (m *GeoIPOptions) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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