handle

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FullHTMLHandler added in v1.8.0

func FullHTMLHandler(w http.ResponseWriter, info *conf.IPInfo, _ *BuildInfo) error

FullHTMLHandler is handler for full text/html response.

func HTMLHandler added in v1.5.0

func HTMLHandler(w http.ResponseWriter, info *conf.IPInfo, _ *BuildInfo) error

HTMLHandler is handler for text/html response.

func JSONHandler

func JSONHandler(w http.ResponseWriter, info *conf.IPInfo, _ *BuildInfo) error

JSONHandler is handler for application/json response.

func TextCompactHandler added in v1.7.0

func TextCompactHandler(w http.ResponseWriter, info *conf.IPInfo, _ *BuildInfo) error

TextCompactHandler is handler for text/plain response with compact info.

func TextHandler

func TextHandler(w http.ResponseWriter, r *http.Request, cfg *conf.Cfg, info *conf.IPInfo) error

TextHandler is handler for text/plain response.

func TextShortHandler

func TextShortHandler(w http.ResponseWriter, info *conf.IPInfo, _ *BuildInfo) error

TextShortHandler is handler for text/plain response with short info. It returns only IP address, country, city and time.

func VersionHandler added in v1.6.0

func VersionHandler(w http.ResponseWriter, _ *conf.IPInfo, buildInfo *BuildInfo) error

VersionHandler is handler for version information.

func XMLHandler added in v1.4.0

func XMLHandler(w http.ResponseWriter, info *conf.IPInfo, _ *BuildInfo) error

XMLHandler is handler for application/xml response.

Types

type BuildInfo added in v1.6.0

type BuildInfo struct {
	Version   string
	Revision  string
	BuildDate string
	GoVersion string
}

BuildInfo is a struct for version information.

func (*BuildInfo) String added in v1.6.0

func (b *BuildInfo) String() string

String returns a string representation of BuildInfo.

type XMLInfo added in v1.4.0

type XMLInfo struct {
	XMLName xml.Name `xml:"ipinfo"`
	conf.IPInfo
}

XMLInfo is a struct for application/xml response data.

Jump to

Keyboard shortcuts

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