controllers

package module
v0.0.0-...-f646e76 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: MIT Imports: 14 Imported by: 1

README

controllers

Build Status GoDoc Go Report Card

PREST handlers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

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

Auth controller

func BatchInsertInTables

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

BatchInsertInTables perform insert in specific table from a batch request

func DeleteFromTable

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

DeleteFromTable perform delete sql

func ExecuteFromScripts

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

ExecuteFromScripts is a controller to peform SQL in scripts created by users

func ExecuteScriptQuery

func ExecuteScriptQuery(rq *http.Request, queriesPath string, script string) ([]byte, error)

ExecuteScriptQuery is a function to execute and return result of script query

func GetDatabases

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

GetDatabases list all (or filter) databases

func GetSchemas

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

GetSchemas list all (or filter) schemas

func GetTables

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

GetTables list all (or filter) tables

func GetTablesByDatabaseAndSchema

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

GetTablesByDatabaseAndSchema list all (or filter) tables based on database and schema

func InsertInTables

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

InsertInTables perform insert in specific table

func SelectFromTables

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

SelectFromTables perform select in database

func ShowTable

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

ShowTable show information from table

func Token

func Token(u auth.User) (t string, err error)

Token for user

func UpdateTable

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

UpdateTable perform update table

Types

type Login

type Login struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Login representation of data received in authentication

type RavensRequest

type RavensRequest struct {
	Type       string   `json:"type_of"`
	Subject    string   `json:"subject"`
	Recipients []string `json:"recipients"`
	Sender     string   `json:"sender"`
	SenderName string   `json:"sender_name"`
	Content    string   `json:"content"`
}

RavensRequest representation

type Response

type Response struct {
	LoggedUser interface{} `json:"user_info"`
	Token      string      `json:"token"`
}

Response representation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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