router

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package router contains the handler for the database

Index

Constants

View Source
const (
	GET    methodType = "GET"
	POST   methodType = "POST"
	PUT    methodType = "PUT"
	DELETE methodType = "DELETE"
)

Variables

This section is empty.

Functions

func CORS

func CORS() func(next http.Handler) http.Handler

func MountRouter

func MountRouter(handler DBHandler) (*http.ServeMux, error)

Types

type BaseHTMLData

type BaseHTMLData struct {
	Tables      []models.ListTablesRow
	Cols        []models.ListDataCol
	ActiveTable string
}

type DBHandler

type DBHandler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(service service.DBService, itemsLimit int) DBHandler

func (DBHandler) CreeteNewTable

func (h DBHandler) CreeteNewTable(w http.ResponseWriter, r *http.Request)

func (DBHandler) DeleteRow

func (h DBHandler) DeleteRow(w http.ResponseWriter, r *http.Request)

func (*DBHandler) DeleteTable

func (h *DBHandler) DeleteTable(w http.ResponseWriter, r *http.Request)

func (DBHandler) InsertOrUpdateRow

func (h DBHandler) InsertOrUpdateRow(w http.ResponseWriter, r *http.Request)

func (DBHandler) ListColumns

func (h DBHandler) ListColumns(w http.ResponseWriter, r *http.Request)

func (*DBHandler) ListHistory

func (h *DBHandler) ListHistory(w http.ResponseWriter, r *http.Request)

func (*DBHandler) ListRecentHistory

func (h *DBHandler) ListRecentHistory(w http.ResponseWriter, r *http.Request)

func (DBHandler) ListRows

func (h DBHandler) ListRows(w http.ResponseWriter, r *http.Request)

func (DBHandler) ListTables

func (h DBHandler) ListTables(w http.ResponseWriter, r *http.Request)

func (DBHandler) NewTableFormFileds

func (h DBHandler) NewTableFormFileds(w http.ResponseWriter, r *http.Request)

func (DBHandler) RowInsertForm

func (h DBHandler) RowInsertForm(w http.ResponseWriter, r *http.Request)

type DeleteTableRequest

type DeleteTableRequest struct {
	TableName         string `json:"tableName"`
	VerificationQuiry string `json:"verificationQuery"`
}

type ErrorMessage

type ErrorMessage struct {
	Message string
}

type ListRowsResponse

type ListRowsResponse struct {
	Page        int                  `json:"page"`
	Rows        models.ListDataRow   `json:"rows"`
	Cols        []models.ListDataCol `json:"cols"`
	RowCount    int                  `json:"rowCount"`
	ActiveTable string               `json:"activeTable"`
	HasNextPage bool                 `json:"hasNextPage"`
	TotalPages  int                  `json:"totalPages"`
}

Jump to

Keyboard shortcuts

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