controllers

package
v0.0.0-...-fef3475 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDatabase

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

CreateDatabase with the given name

func CreateQuery

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

CreateQuery compile query and lookup for results on a specified database

func DeleteDatabase

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

DeleteDatabase with the given name

func GetData

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

GetData from database to JSON

func InsertData

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

InsertData into a specified table into a specified database

func Login

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

Login with the admin name and the token

func Signin

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

Signin handler to handle signin request

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

Claims struct that will be encoded to a JWT. We add jwt.StandardClaims as an embedded type, to provide fields like expiry time

type Credentials

type Credentials struct {
	Username string `json:"username"`
}

Credentials struct to read the username from the request body

type Database

type Database struct {
	Name string `json:"name"`
}

Database struct to read database name from the request body

type Insert

type Insert struct {
	Database string `json:"database"`
	Query    string `json:"query"`
	Content  string `json:"content"`
}

Insert struct

type Query

type Query struct {
	Name    string `json:"database"`
	Content string `json:"query"`
}

Query struct

Jump to

Keyboard shortcuts

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