consts.go 678 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package qqwry
  2. import (
  3. "net/http"
  4. "os"
  5. )
  6. const (
  7. // IndexLen 索引长度
  8. IndexLen = 7
  9. // RedirectMode1 国家的类型, 指向另一个指向
  10. RedirectMode1 = 0x01
  11. // RedirectMode2 国家的类型, 指向一个指向
  12. RedirectMode2 = 0x02
  13. )
  14. // ResultQQwry 归属地信息
  15. type ResultQQwry struct {
  16. IP string `json:"ip"`
  17. Country string `json:"country"`
  18. Area string `json:"area"`
  19. }
  20. type fileData struct {
  21. Data []byte
  22. FilePath string
  23. Path *os.File
  24. IPNum int64
  25. }
  26. // QQwry 纯真ip库
  27. type QQwry struct {
  28. Data *fileData
  29. Offset int64
  30. }
  31. // Response 向客户端返回数据的
  32. type Response struct {
  33. r *http.Request
  34. w http.ResponseWriter
  35. }