api

package
v1.0.1-0...-fed4e36 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package api contains files responsible for defining and serving the restful api

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteKey

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

DeleteKey deletes the file associated with the given key, returns 404 if not found

func GetIndex

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

GetIndex returns a JSON of all files in db index

func GetKey

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

GetKey returns the file with that key if found, otherwise return 404

func GetKeyField

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

GetKeyField returns key's field, 404 if not found

func PatchKeyField

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

PatchKeyField modifies the field of a key

func RegenerateIndex

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

RegenerateIndex rebuilds main index with saved directory

func UpdateKey

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

UpdateKey creates or updates the file with that key with the request body

Types

This section is empty.

Jump to

Keyboard shortcuts

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