Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var IP2LOCATION []byte
Functions ¶
func WriteError ¶
func WriteError(w http.ResponseWriter, status int)
Types ¶
type ApiHandler ¶
type ApiHandler struct {
Method string `json:"method"`
Pattern string `json:"pattern"` // Context path pattern
Desc string `json:"desc"` // What does the endpoint do?
// args []string // List of human-readable argument names
Handler func(w http.ResponseWriter, r *http.Request) // First is input map, second is output
}
type Peer ¶
type Peer struct {
Address string `json:"address"`
Key string `json:"key"`
Port uint64 `json:"port"`
Priority uint64 `json:"priority"`
Coords []uint64 `json:"coords"`
Remote string `json:"remote"`
Remote_ip string `json:"remote_ip"`
Bytes_recvd uint64 `json:"bytes_recvd"`
Bytes_sent uint64 `json:"bytes_sent"`
Uptime float64 `json:"uptime"`
Multicast bool `json:"multicast"`
Country_short string `json:"country_short"`
Country_long string `json:"country_long"`
}
type RestServer ¶
type RestServer struct {
RestServerCfg
// contains filtered or unexported fields
}
func NewRestServer ¶
func NewRestServer(cfg RestServerCfg) (*RestServer, error)
func (*RestServer) AddHandler ¶
func (a *RestServer) AddHandler(handler ApiHandler) error
AddHandler is called for each admin function to add the handler and help documentation to the API.
type RestServerCfg ¶
type ServerEvent ¶
Click to show internal directories.
Click to hide internal directories.