http

package
v0.0.0-...-bcc622c Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobalMiddleware

func GlobalMiddleware(scheme string, next http.Handler) http.Handler

func NewRouter

func NewRouter() *router

func NotFoundHandler

func NotFoundHandler(w http.ResponseWriter, r *http.Request) *appError

Types

type PortResponse

type PortResponse struct {
	HTTP2Support bool   `json:"http2"`
	IP           net.IP `json:"ip"`
	Port         uint64 `json:"port"`
	Reachable    bool   `json:"reachable"`
}

type Response

type Response struct {
	HTTP2Support bool   `json:"http2"`
	IP           net.IP `json:"ip"`
	IPDecimal    uint64 `json:"ip_decimal"`
	Country      string `json:"country,omitempty"`
	CountryISO   string `json:"country_iso,omitempty"`
	City         string `json:"city,omitempty"`
	Hostname     string `json:"hostname,omitempty"`
}

type Server

type Server struct {
	Template   string
	IPHeader   string
	LookupAddr func(net.IP) (string, error)
	LookupPort func(net.IP, uint64) error
	TLS        map[string]string
	// contains filtered or unexported fields
}

func New

func New(db database.Client) *Server

func (*Server) CLICityHandler

func (s *Server) CLICityHandler(w http.ResponseWriter, r *http.Request) *appError

func (*Server) CLICountryHandler

func (s *Server) CLICountryHandler(w http.ResponseWriter, r *http.Request) *appError

func (*Server) CLICountryISOHandler

func (s *Server) CLICountryISOHandler(w http.ResponseWriter, r *http.Request) *appError

func (*Server) CLIHandler

func (s *Server) CLIHandler(w http.ResponseWriter, r *http.Request) *appError

func (*Server) DefaultHandler

func (s *Server) DefaultHandler(w http.ResponseWriter, r *http.Request) *appError

func (*Server) Handler

func (s *Server) Handler() http.Handler

func (*Server) JSONHandler

func (s *Server) JSONHandler(w http.ResponseWriter, r *http.Request) *appError

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string, sslAddr string, ssl map[string]string) chan error

func (*Server) PortHandler

func (s *Server) PortHandler(w http.ResponseWriter, r *http.Request) *appError

Jump to

Keyboard shortcuts

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