Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewClient ¶
NewClient creates new client with the given config and immediately updates its database. It will also run automatic updates, if interval is specified.
func (*Client) FindIP ¶
FindIP checks if a given IP is on the list. If so, returns `true` and the reason (IP block).
func (*Client) StartServer ¶
StartServer starts HTTP server for IP queries. Available endpoints: /ip. Usage is in README.
type Config ¶
type Config struct { DatabaseDownloadURL string DatabaseUpdateInterval string WebserverPort string WebserverToken string Debug bool }
Config is a structure of environmental variables
type IpEndpointResponse ¶
type IpEndpointResponse = struct { IP string `json:"ip"` Proxy bool `json:"proxy"` Rule string `json:"rule"` }
IpEndpointResponse is a structure of /ip endpoint response
Click to show internal directories.
Click to hide internal directories.