handlers

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectRequest

type ConnectRequest struct {
	URI    string `json:"uri"`
	Name   string `json:"name"`
	Schema string `json:"schema,omitempty"`
}

ConnectRequest represents a database connection request

type ConnectionHandler

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

ConnectionHandler handles database connections

func NewConnectionHandler

func NewConnectionHandler(l logger.Logger) *ConnectionHandler

NewConnectionHandler creates a new connection handler

func (*ConnectionHandler) AddConnection

func (h *ConnectionHandler) AddConnection(name string, db database.Database)

AddConnection adds a database connection with a given name

func (*ConnectionHandler) Connect

func (h *ConnectionHandler) Connect(w http.ResponseWriter, r *http.Request)

Connect handles database connection requests

func (*ConnectionHandler) Disconnect

func (h *ConnectionHandler) Disconnect(w http.ResponseWriter, r *http.Request)

Disconnect handles database disconnection requests

func (*ConnectionHandler) GetConnection

func (h *ConnectionHandler) GetConnection(name string) (database.Database, error)

GetConnection returns a database connection by name

func (*ConnectionHandler) List

List returns all active connections

type DataHandler

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

DataHandler handles data operations

func NewDataHandler

func NewDataHandler(connHandler *ConnectionHandler, l logger.Logger) *DataHandler

NewDataHandler creates a new data handler

func (*DataHandler) BatchCreate

func (h *DataHandler) BatchCreate(w http.ResponseWriter, r *http.Request)

BatchCreate handles creating multiple records

func (*DataHandler) Create

func (h *DataHandler) Create(w http.ResponseWriter, r *http.Request)

Create handles creating a new record

func (*DataHandler) Delete

func (h *DataHandler) Delete(w http.ResponseWriter, r *http.Request)

Delete handles deleting a record

func (*DataHandler) Find

func (h *DataHandler) Find(w http.ResponseWriter, r *http.Request)

Find handles finding multiple records

func (*DataHandler) FindOne

func (h *DataHandler) FindOne(w http.ResponseWriter, r *http.Request)

FindOne handles finding a single record

func (*DataHandler) Update

func (h *DataHandler) Update(w http.ResponseWriter, r *http.Request)

Update handles updating a record

Jump to

Keyboard shortcuts

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