service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIP

func GetIP(r *http.Request) net.IP

GetIP returns the IP address

func GetVersion

func GetVersion(ip net.IP) int

Returns the IP address version number (4 or 6); Returns 0 on error

func NewServer

func NewServer() *http.ServeMux

func RedirectURL

func RedirectURL(toV6 bool, tls *tls.ConnectionState) string

RedirectURL constructs the redirection URL.

func ReturnIP

func ReturnIP(w http.ResponseWriter, r *http.Request)

func Usage

func Usage(w http.ResponseWriter, r *http.Request)

Types

type Response

type Response struct {
	Address   string `json:"address"`
	Version   int    `json:"version"`
	Error     string `json:"error,omitempty"`
	ErrorCode int    `json:"errorCode,omitempty"`
	Usage     string `json:"usage"`
}

Response is the the structure of the response sent from the server.

Jump to

Keyboard shortcuts

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