httpd

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: MPL-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// APIURL is prefix for REST API URL.
	APIURL = "/api"
	// UIURL is prefix for Web UI URL.
	UIURL = "/ui"
)

Variables

View Source
var (
	CORSEnabled bool
)

Functions

func Browse

func Browse(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

Browse is controller for file browse.

func CreateMap

func CreateMap(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

CreateMap creates new Map.

func CreateResources

func CreateResources(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

CreateResource creates new Resources.

func DeleteMap

func DeleteMap(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

DeleteMap is controller for deleting a map.

func DeleteResource

func DeleteResource(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

DeleteResource is controller for deleting a resource.

func DeleteResources

func DeleteResources(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

DeleteResources is controller for deleting multiple resources.

func ImportMap

func ImportMap(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ImportMap imports existing Map.

func Index

Index is controller for root URL

func Info

Info is controller for information

func OpenResource

func OpenResource(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

OpenResource is controller for opening a resource.

func ReadConfig

func ReadConfig(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func ReadMap

func ReadMap(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ReadMap is controller for getting a map.

func ReadMaps

func ReadMaps(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

ReadMaps is controller for getting maps. Returns array of all maps, sorted by Opened field.

func ReadResource

func ReadResource(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ReadResource is controller for getting a resource.

func RunHTTP

func RunHTTP(addr string, webUIPath string)

RunHTTP starts HTTP server

func UpdateMap

func UpdateMap(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

UpdateMap updates existing Map.

func UpdateResources

func UpdateResources(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

UpdateResource updates existing resource.

func WriteConfig

func WriteConfig(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

ConfigCtrl is controller for configuration.

func WriteJSON

func WriteJSON(w http.ResponseWriter, v interface{}) error

WriteJSON writes JSON response

func WriteJSONError

func WriteJSONError(w http.ResponseWriter, code int, err string)

WriteJSONError writes error JSON response

Types

type ResourcesResponse

type ResourcesResponse struct {
	Resources []*model.Resource `json:"resources"`
}

ResourceResponse is struct used for JSON response.

Jump to

Keyboard shortcuts

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