api

package
v0.0.0-...-c6da559 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2015 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IP_HEADER        = "x-ifconfig-ip"
	COUNTRY_HEADER   = "x-ifconfig-country"
	HOSTNAME_HEADER  = "x-ifconfig-hostname"
	TEXT_PLAIN       = "text/plain; charset=utf-8"
	APPLICATION_JSON = "application/json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	CORS     bool
	Template string
	// contains filtered or unexported fields
}

func New

func New() *API

func NewWithGeoIP

func NewWithGeoIP(filepath string) (*API, error)

func (*API) CLIHandler

func (a *API) CLIHandler(w http.ResponseWriter, r *http.Request) *appError

func (*API) DefaultHandler

func (a *API) DefaultHandler(w http.ResponseWriter, r *http.Request) *appError

func (*API) Handlers

func (a *API) Handlers() http.Handler

func (*API) JSONAllHandler

func (a *API) JSONAllHandler(w http.ResponseWriter, r *http.Request) *appError

func (*API) JSONHandler

func (a *API) JSONHandler(w http.ResponseWriter, r *http.Request) *appError

func (*API) ListenAndServe

func (a *API) ListenAndServe(addr string) error

type Cmd

type Cmd struct {
	Name string
	Args string
}

func (*Cmd) String

func (c *Cmd) String() string

Jump to

Keyboard shortcuts

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