route

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPAdd

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

IPAdd for the Create action POST /ip

func IPDelete

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

IPDelete for the ip Delete action DELETE /ip/{ip}

func IPShow

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

IPShow for the ip Show action GET /ip/{ip}

func Index

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

Index page GET /

func NewRouter

func NewRouter() *mux.Router

NewRouter creates a new mux router for application

func ShowAllIPs

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

ShowAllIPs shows all IPs GET /ip

Types

type APIError

type APIError struct {
	Status int    `json:"status"`
	Title  string `json:"title"`
}

APIError defines api error struct

type JSONErrorResponse

type JSONErrorResponse struct {
	Error *APIError `json:"error"`
}

JSONErrorResponse defines error struct

type JSONResponse

type JSONResponse struct {
	// Reserved field to add some meta information to the API response
	Meta interface{} `json:"meta"`
	Data interface{} `json:"data"`
}

JSONResponse defines meta and interface struct

Jump to

Keyboard shortcuts

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