Documentation
¶
Overview ¶
Package apiserver provides the freegeoip web server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "3.4.1"
Version tag.
Functions ¶
func NewHandler ¶
NewHandler creates an http handler for the freegeoip server that can be embedded in other servers.
Types ¶
type Config ¶
type Config struct {
FastOpen bool `envconfig:"TCP_FAST_OPEN"`
Naggle bool `envconfig:"TCP_NAGGLE"`
ServerAddr string `envconfig:"HTTP"`
HTTP2 bool `envconfig:"HTTP2"`
HSTS string `envconfig:"HSTS"`
TLSServerAddr string `envconfig:"HTTPS"`
TLSCertFile string `envconfig:"CERT"`
TLSKeyFile string `envconfig:"KEY"`
LetsEncrypt bool `envconfig:"LETSENCRYPT"`
LetsEncryptCacheDir string `envconfig:"LETSENCRYPT_CACHE_DIR"`
LetsEncryptEmail string `envconfig:"LETSENCRYPT_EMAIL"`
LetsEncryptHosts string `envconfig:"LETSENCRYPT_HOSTS"`
APIPrefix string `envconfig:"API_PREFIX"`
CORSOrigin string `envconfig:"CORS_ORIGIN"`
ReadTimeout time.Duration `envconfig:"READ_TIMEOUT"`
WriteTimeout time.Duration `envconfig:"WRITE_TIMEOUT"`
PublicDir string `envconfig:"PUBLIC"`
DB string `envconfig:"DB"`
UpdateInterval time.Duration `envconfig:"UPDATE_INTERVAL"`
RetryInterval time.Duration `envconfig:"RETRY_INTERVAL"`
UseXForwardedFor bool `envconfig:"USE_X_FORWARDED_FOR"`
Silent bool `envconfig:"SILENT"`
LogToStdout bool `envconfig:"LOGTOSTDOUT"`
LogTimestamp bool `envconfig:"LOGTIMESTAMP"`
RedisAddr string `envconfig:"REDIS"`
RedisTimeout time.Duration `envconfig:"REDIS_TIMEOUT"`
MemcacheAddr string `envconfig:"MEMCACHE"`
MemcacheTimeout time.Duration `envconfig:"MEMCACHE_TIMEOUT"`
RateLimitBackend string `envconfig:"QUOTA_BACKEND"`
RateLimitLimit uint64 `envconfig:"QUOTA_MAX"`
RateLimitInterval time.Duration `envconfig:"QUOTA_INTERVAL"`
InternalServerAddr string `envconfig:"INTERNAL_SERVER"`
UpdatesHost string `envconfig:"UPDATES_HOST"`
LicenseKey string `envconfig:"LICENSE_KEY"`
UserID string `envconfig:"USER_ID"`
ProductID string `envconfig:"PRODUCT_ID"`
NewrelicName string `envconfig:"NEWRELIC_NAME"`
NewrelicKey string `envconfig:"NEWRELIC_KEY"`
// contains filtered or unexported fields
}
Config is the configuration of the freegeoip server.
Click to show internal directories.
Click to hide internal directories.