iplists

package
v0.0.0-...-84d4900 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package iplists control the access by the referrer address or ip address.

Package iplists control the access by the referrer address or ip address.

Index

Constants

View Source
const ErrIterStop = "stop iter"

Variables

This section is empty.

Functions

func IPBlock

func IPBlock(deny list.List, handler http.HandlerFunc) http.HandlerFunc

func Referrer

func Referrer(def DefaultRule, allowed, deny list.List, fbc *FBCrawler, handler http.HandlerFunc) http.HandlerFunc

Referrer checks the referrer url

Types

type DefaultRule

type DefaultRule uint8
const (
	DENY DefaultRule = iota
	ALLOW
)

type FBCrawler

type FBCrawler struct {
	Server  string
	Port    string
	AS      []string
	Refresh time.Duration
	Cache   string
	// contains filtered or unexported fields
}

FBCrawler contains the information about the crawlers.

func NewFBCrawler

func NewFBCrawler(server, port string, refresh time.Duration, cache string, AS ...string) (*FBCrawler, error)

NewFBCrawler create a new crawler query.

func (*FBCrawler) HaveIP

func (fbc *FBCrawler) HaveIP(ipstr string) bool

HaveIP return true if ip is a crawler.

func (*FBCrawler) Iter

func (fbc *FBCrawler) Iter(f func(string, *Object) error) error

type Object

type Object struct {
	Route   *net.IPNet
	Descr   string
	Origin  string
	MntBy   string
	Changed string
	Source  string
}

Object is the whois AS object

Jump to

Keyboard shortcuts

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