Documentation
¶
Index ¶
- func NewRouter() *router
- func NotFoundHandler(w http.ResponseWriter, r *http.Request) *appError
- type Cache
- type CacheStats
- type PortResponse
- type Response
- type Server
- func (s *Server) CLIASNHandler(w http.ResponseWriter, r *http.Request) *appError
- func (s *Server) CLIASNOrgHandler(w http.ResponseWriter, r *http.Request) *appError
- func (s *Server) CLICityHandler(w http.ResponseWriter, r *http.Request) *appError
- func (s *Server) CLICoordinatesHandler(w http.ResponseWriter, r *http.Request) *appError
- func (s *Server) CLICountryHandler(w http.ResponseWriter, r *http.Request) *appError
- func (s *Server) CLICountryISOHandler(w http.ResponseWriter, r *http.Request) *appError
- func (s *Server) CLIHandler(w http.ResponseWriter, r *http.Request) *appError
- func (s *Server) DefaultHandler(w http.ResponseWriter, r *http.Request) *appError
- func (s *Server) Handler() http.Handler
- func (s *Server) HealthHandler(w http.ResponseWriter, r *http.Request) *appError
- func (s *Server) JSONHandler(w http.ResponseWriter, r *http.Request) *appError
- func (s *Server) ListenAndServe(addr string) error
- func (s *Server) PortHandler(w http.ResponseWriter, r *http.Request) *appError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NotFoundHandler ¶
func NotFoundHandler(w http.ResponseWriter, r *http.Request) *appError
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) Stats ¶
func (c *Cache) Stats() CacheStats
type CacheStats ¶
type PortResponse ¶
type Response ¶
type Response struct {
IP net.IP `json:"ip"`
IPDecimal *big.Int `json:"ip_decimal"`
Country string `json:"country,omitempty"`
CountryISO string `json:"country_iso,omitempty"`
CountryEU *bool `json:"country_eu,omitempty"`
RegionName string `json:"region_name,omitempty"`
RegionCode string `json:"region_code,omitempty"`
MetroCode uint `json:"metro_code,omitempty"`
PostalCode string `json:"zip_code,omitempty"`
City string `json:"city,omitempty"`
Latitude float64 `json:"latitude,omitempty"`
Longitude float64 `json:"longitude,omitempty"`
Timezone string `json:"time_zone,omitempty"`
ASN string `json:"asn,omitempty"`
ASNOrg string `json:"asn_org,omitempty"`
Hostname string `json:"hostname,omitempty"`
UserAgent *useragent.UserAgent `json:"user_agent,omitempty"`
}
type Server ¶
type Server struct {
Template string
IPHeaders []string
LookupAddr func(net.IP) (string, error)
LookupPort func(net.IP, uint64) error
Sponsor bool
// contains filtered or unexported fields
}
func (*Server) CLIASNHandler ¶
func (s *Server) CLIASNHandler(w http.ResponseWriter, r *http.Request) *appError
func (*Server) CLIASNOrgHandler ¶
func (s *Server) CLIASNOrgHandler(w http.ResponseWriter, r *http.Request) *appError
func (*Server) CLICityHandler ¶
func (s *Server) CLICityHandler(w http.ResponseWriter, r *http.Request) *appError
func (*Server) CLICoordinatesHandler ¶
func (s *Server) CLICoordinatesHandler(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) HealthHandler ¶
func (s *Server) HealthHandler(w http.ResponseWriter, r *http.Request) *appError
func (*Server) JSONHandler ¶
func (s *Server) JSONHandler(w http.ResponseWriter, r *http.Request) *appError
func (*Server) ListenAndServe ¶
func (*Server) PortHandler ¶
func (s *Server) PortHandler(w http.ResponseWriter, r *http.Request) *appError
Click to show internal directories.
Click to hide internal directories.