Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - func ClearZero(info *ip2region.IpInfo)
 - func ErrIsInvalidIP(err error) bool
 - func FindIPv4(content string) string
 - func FindIPv6(content string) string
 - func IPInfo(ip string) (info ip2region.IpInfo, err error)
 - func IsInitialized() bool
 - func IsZero(str string) bool
 - func Register(p *WANIPProvider) (err error)
 - func SetDictFile(f string)
 - func SetInstance(newInstance *ip2region.Ip2Region)
 - func Stringify(info ip2region.IpInfo, jsonify ...bool) string
 - func Unregister(names ...string)
 - type WANIP
 - type WANIPProvider
 - type WANIPProviders
 
Constants ¶
      View Source
      
  
const ( IPv4Rule = `((?:(?:25[0-5]|(?:2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(?:25[0-5]|(?:2[0-4]|1{0,1}[0-9]){0,1}[0-9]))` IPv6Rule = `` /* 1211-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func IsInitialized ¶
func IsInitialized() bool
func Register ¶
func Register(p *WANIPProvider) (err error)
func SetDictFile ¶
func SetDictFile(f string)
func SetInstance ¶
func Unregister ¶
func Unregister(names ...string)
Types ¶
type WANIPProvider ¶
type WANIPProvider struct {
	Name        string
	Description string
	URL         string
	Method      string
	IP4Rule     string // 如果是IPv4规则,此项可以为空
	IP6Rule     string // 如果是IPv6规则,此项不能为空(“=”代表整个body数据)
	Disabled bool
	// contains filtered or unexported fields
}
    func Get ¶
func Get(name string) *WANIPProvider
func (*WANIPProvider) HasIPv4Rule ¶
func (w *WANIPProvider) HasIPv4Rule() bool
func (*WANIPProvider) HasIPv6Rule ¶
func (w *WANIPProvider) HasIPv6Rule() bool
type WANIPProviders ¶
type WANIPProviders map[string]*WANIPProvider
func (*WANIPProviders) Reload ¶
func (w *WANIPProviders) Reload() error
 Click to show internal directories. 
   Click to hide internal directories.