You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.7 KiB
68 lines
1.7 KiB
package main
|
|
|
|
import (
|
|
"dsDataex/MyTask/Kafka2ES/Kafka2ESService"
|
|
"dsDataex/Utils/CacheUtil"
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
var ChanCount chan int
|
|
var Count =0
|
|
|
|
func main() {
|
|
|
|
fmt.Println("Kafka2ES Task One Start !!!")
|
|
|
|
//s1 := gocron.NewScheduler(time.UTC)
|
|
//
|
|
//s1.Every(5).Seconds().Do(proc)
|
|
//s1.Every(5).Seconds().Do(proc)
|
|
//s1.StartBlocking()
|
|
|
|
//go proc()
|
|
//go proc()
|
|
//time.Sleep(60 * time.Minute)
|
|
|
|
CacheUtil.OrgtreeCacheInit()
|
|
|
|
Kafka2ESService.ServiceStart()
|
|
|
|
//db, _ := geoip2.Open("GeoLite2/GeoLite2-City.mmdb")
|
|
//defer db.Close()
|
|
//
|
|
//ip := net.ParseIP("124.235.206.60")
|
|
//record, _ := db.City(ip)
|
|
//
|
|
////fmt.Println("GeoLite2 :",record)
|
|
//fmt.Println(record.Country.Names["ch-ZN"],record.Subdivisions[0].Names["zh-CN"], record.City.Names["zh-CN"])
|
|
|
|
//fmt.Println(GeoIPUtil.GetGeo4IP("124.235.206.60"))
|
|
//fmt.Println(GeoIPUtil.GetGeo4IP("202.106.212.226"))
|
|
//fmt.Println(GeoIPUtil.GetGeo4IP("220.181.38.148"))
|
|
//fmt.Println(GeoIPUtil.GetGeo4IP("123.103.122.24"))
|
|
//fmt.Println(GeoIPUtil.GetGeo4IP("222.161.206.62"))
|
|
//fmt.Println(GeoIPUtil.GetGeo4IP("121.28.35.6"))
|
|
|
|
//q := qqwry.NewQQwry("GeoLite2/qqwry.dat")
|
|
//q.Find("222.161.206.62")
|
|
////fmt.Printf("ip:%v, Country:%v, City:%v", q.Ip, q.Country, q.City)
|
|
//fmt.Println("qqwry :",q.Country,q.City,q.Ip)
|
|
|
|
|
|
//fmt.Println("ChunZhen :",cz88.GetAddress("124.235.206.60"))
|
|
//fmt.Println("ChunZhen :",cz88.GetAddress("202.106.212.226"))
|
|
//fmt.Println("ChunZhen :",cz88.GetAddress("220.181.38.148"))
|
|
//fmt.Println("ChunZhen :",cz88.GetAddress("123.103.122.24"))
|
|
//fmt.Println("ChunZhen :",cz88.GetAddress("222.161.206.62"))
|
|
}
|
|
|
|
func proc() {
|
|
for no:=0;no<1000;no++{
|
|
Count++
|
|
fmt.Println("Count :",Count)
|
|
time.Sleep(1 * time.Millisecond)
|
|
}
|
|
}
|
|
|