apiserver

package
v3.1.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2016 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Overview

Package apiserver provides the freegeoip web server.

Index

Constants

This section is empty.

Variables

View Source
var Version = "3.1.5"

Version tag.

Functions

func NewHandler

func NewHandler(c *Config) (http.Handler, error)

NewHandler creates an http handler for the freegeoip server that can be embedded in other servers.

func Run

func Run()

Run is the entrypoint for the freegeoip server.

Types

type Config

type Config struct {
	ServerAddr         string
	TLSServerAddr      string
	TLSCertFile        string
	TLSKeyFile         string
	APIPrefix          string
	CORSOrigin         string
	ReadTimeout        time.Duration
	WriteTimeout       time.Duration
	PublicDir          string
	DB                 string
	UpdateInterval     time.Duration
	RetryInterval      time.Duration
	UseXForwardedFor   bool
	Silent             bool
	LogToStdout        bool
	LogTimestamp       bool
	RedisAddr          string
	RedisTimeout       time.Duration
	MemcacheAddr       string
	MemcacheTimeout    time.Duration
	RateLimitBackend   string
	RateLimitLimit     uint64
	RateLimitInterval  time.Duration
	InternalServerAddr string
	UpdatesHost        string
	LicenseKey         string
	UserID             string
	ProductID          string
	// contains filtered or unexported fields
}

Config is the configuration of the freegeoip server.

func NewConfig

func NewConfig() *Config

NewConfig creates and initializes a new Config with default values.

func (*Config) AddFlags

func (c *Config) AddFlags(fs *flag.FlagSet)

AddFlags adds configuration flags to the given FlagSet.

Jump to

Keyboard shortcuts

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