server

package
v0.0.0-...-b6cbe2a Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerList = [2][]Server{}
)

Functions

func FindIPs

func FindIPs(c *gin.Context, server Server)

FindIPs get information about a list of ip by server asynchronously

func GetIP

func GetIP(c *gin.Context)

GetIP get information about a list of ip by ServerList first, ip2region asynchronously; then chunzhe; then geoip2; at last, query by api

func Register

func Register(server Server, routine bool)

Register register server, only one server can set the routine param to true

Types

type Server

type Server interface {
	// FindIP find information about a single IP
	FindIP(ip string, ch chan config.IPWithGeo, wg *sync.WaitGroup) *config.IPWithGeo
	// Register register server
	Register(routine bool)
}

Server you can register your own ip recognition service by implement this interface

Jump to

Keyboard shortcuts

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