Documentation ¶
Index ¶
- Constants
- type IPInfoFreeChecksumResponse
- type IPInfoFreeHandler
- func (IPInfoFreeHandler) CaddyModule() caddy.ModuleInfo
- func (m *IPInfoFreeHandler) Provision(ctx caddy.Context) error
- func (m IPInfoFreeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
- func (m *IPInfoFreeHandler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (m *IPInfoFreeHandler) Validate() error
- type IPInfoFreeState
- func (IPInfoFreeState) CaddyModule() caddy.ModuleInfo
- func (m *IPInfoFreeState) Cleanup() error
- func (m *IPInfoFreeState) Provision(ctx caddy.Context) error
- func (m *IPInfoFreeState) Start() error
- func (m *IPInfoFreeState) Stop() error
- func (m *IPInfoFreeState) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (m *IPInfoFreeState) Validate() error
- type IPInfoRecord
Constants ¶
View Source
const ( DEFAULT_CRON = "10 16 * * *" CRON_NAME_UPDATE = "update" CRON_NAME_INITIAL_UPDATE = "initial-update" ID_MODULE_STATE = "caddy.states.ipinfo-free" )
View Source
const (
ID_MODULE_HANDLER = "http.handlers.ipinfo-free"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPInfoFreeChecksumResponse ¶
type IPInfoFreeChecksumResponse struct { Checksums struct { MD5 string `json:"md5"` SHA1 string `json:"sha1"` SHA256 string `json:"sha256"` } `json:"checksums"` }
Structure to unmarshal response from https://ipinfo.io/data/free/country.mmdb/checksums?token=magicduck
type IPInfoFreeHandler ¶
type IPInfoFreeHandler struct { Mode string `json:"mode,omitempty"` // contains filtered or unexported fields }
func (IPInfoFreeHandler) CaddyModule ¶
func (IPInfoFreeHandler) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information
func (*IPInfoFreeHandler) Provision ¶
func (m *IPInfoFreeHandler) Provision(ctx caddy.Context) error
func (IPInfoFreeHandler) ServeHTTP ¶
func (m IPInfoFreeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
func (*IPInfoFreeHandler) UnmarshalCaddyfile ¶
func (m *IPInfoFreeHandler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler.
func (*IPInfoFreeHandler) Validate ¶
func (m *IPInfoFreeHandler) Validate() error
type IPInfoFreeState ¶
type IPInfoFreeState struct { Url string `json:"url,omitempty"` Cron string `json:"cron,omitempty"` Path string `json:"path,omitempty"` // contains filtered or unexported fields }
Define our module with optional json fields that can be stored by caddy
func (IPInfoFreeState) CaddyModule ¶
func (IPInfoFreeState) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information
func (*IPInfoFreeState) Cleanup ¶
func (m *IPInfoFreeState) Cleanup() error
func (*IPInfoFreeState) Provision ¶
func (m *IPInfoFreeState) Provision(ctx caddy.Context) error
func (*IPInfoFreeState) Start ¶
func (m *IPInfoFreeState) Start() error
func (*IPInfoFreeState) Stop ¶
func (m *IPInfoFreeState) Stop() error
func (*IPInfoFreeState) UnmarshalCaddyfile ¶
func (m *IPInfoFreeState) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler
func (*IPInfoFreeState) Validate ¶
func (m *IPInfoFreeState) Validate() error
type IPInfoRecord ¶
type IPInfoRecord struct { Country string `maxminddb:"country"` CountryName string `maxminddb:"country_name"` Continent string `maxminddb:"continent"` ContinentName string `maxminddb:"continent_name"` ASN string `maxminddb:"asn"` ASName string `maxminddb:"as_name"` ASDomain string `maxminddb:"as_domain"` }
Definee struct for ipinfo database format (not all fields filled depending on database type)
Click to show internal directories.
Click to hide internal directories.