Documentation
¶
Index ¶
- type ConnectRequest
- type ConnectionHandler
- func (h *ConnectionHandler) AddConnection(name string, db database.Database)
- func (h *ConnectionHandler) Connect(w http.ResponseWriter, r *http.Request)
- func (h *ConnectionHandler) Disconnect(w http.ResponseWriter, r *http.Request)
- func (h *ConnectionHandler) GetConnection(name string) (database.Database, error)
- func (h *ConnectionHandler) List(w http.ResponseWriter, r *http.Request)
- type DataHandler
- func (h *DataHandler) BatchCreate(w http.ResponseWriter, r *http.Request)
- func (h *DataHandler) Create(w http.ResponseWriter, r *http.Request)
- func (h *DataHandler) Delete(w http.ResponseWriter, r *http.Request)
- func (h *DataHandler) Find(w http.ResponseWriter, r *http.Request)
- func (h *DataHandler) FindOne(w http.ResponseWriter, r *http.Request)
- func (h *DataHandler) Update(w http.ResponseWriter, r *http.Request)
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 ¶
func (h *ConnectionHandler) List(w http.ResponseWriter, r *http.Request)
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