Documentation
¶
Overview ¶
api/handlers/auth_handler.go
api/handlers/database_handler.go
api/handlers/record_handler.go
api/handlers/table_handler.go
Index ¶
- type AuthHandler
- type DatabaseHandler
- func (h *DatabaseHandler) CreateAPIKey(c *gin.Context)
- func (h *DatabaseHandler) CreateDatabase(c *gin.Context)
- func (h *DatabaseHandler) CreateSchema(c *gin.Context)
- func (h *DatabaseHandler) DeleteDatabase(c *gin.Context)
- func (h *DatabaseHandler) GetAPIKey(c *gin.Context)
- func (h *DatabaseHandler) GetSchema(c *gin.Context)
- func (h *DatabaseHandler) ListDatabases(c *gin.Context)
- type RecordHandler
- type TableHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHandler ¶
type AuthHandler struct {
DB *sql.DB // Metadata DB connection pool
Cfg *config.Config // Application configuration
}
AuthHandler holds dependencies for authentication handlers.
func NewAuthHandler ¶
func NewAuthHandler(db *sql.DB, cfg *config.Config) *AuthHandler
NewAuthHandler creates a new AuthHandler with dependencies.
func (*AuthHandler) FindUser ¶
func (h *AuthHandler) FindUser(c *gin.Context)
Find handles find user by user_id
func (*AuthHandler) Login ¶
func (h *AuthHandler) Login(c *gin.Context)
Login handles user login requests and issues JWT on success.
func (*AuthHandler) Signup ¶
func (h *AuthHandler) Signup(c *gin.Context)
Signup handles user registration requests.
type DatabaseHandler ¶
type DatabaseHandler struct {
MetaDB *sql.DB // Metadata DB pool
Cfg *config.Config // App configuration
}
DatabaseHandler holds dependencies for DB/Schema management handlers.
func NewDatabaseHandler ¶
func NewDatabaseHandler(metaDB *sql.DB, cfg *config.Config) *DatabaseHandler
NewDatabaseHandler creates a new DatabaseHandler.
func (*DatabaseHandler) CreateAPIKey ¶
func (h *DatabaseHandler) CreateAPIKey(c *gin.Context)
CreateAPIKey generates a new API key scoped to a specific database for the user.
func (*DatabaseHandler) CreateDatabase ¶
func (h *DatabaseHandler) CreateDatabase(c *gin.Context)
CreateDatabase handles requests to register a new user database.
func (*DatabaseHandler) CreateSchema ¶
func (h *DatabaseHandler) CreateSchema(c *gin.Context)
CreateSchema handles requests to define a table schema.
func (*DatabaseHandler) DeleteDatabase ¶
func (h *DatabaseHandler) DeleteDatabase(c *gin.Context)
DeleteDatabase handles requests to delete a database registration and its file.
func (*DatabaseHandler) GetAPIKey ¶
func (h *DatabaseHandler) GetAPIKey(c *gin.Context)
GetAPIKeys fetches all the API keys of the user
func (*DatabaseHandler) GetSchema ¶
func (h *DatabaseHandler) GetSchema(c *gin.Context)
GetSchema returns the schema for a table
func (*DatabaseHandler) ListDatabases ¶
func (h *DatabaseHandler) ListDatabases(c *gin.Context)
ListDatabases handles requests to list registered databases for the user.
type RecordHandler ¶
type RecordHandler struct {
MetaDB *sql.DB // Metadata DB pool
Cfg *config.Config // App configuration
}
RecordHandler holds dependencies for record CRUD handlers.
func NewRecordHandler ¶
func NewRecordHandler(metaDB *sql.DB, cfg *config.Config) *RecordHandler
NewRecordHandler creates a new RecordHandler.
func (*RecordHandler) CreateRecord ¶
func (h *RecordHandler) CreateRecord(c *gin.Context)
CreateRecord handles inserting a new record.
func (*RecordHandler) DeleteRecord ¶
func (h *RecordHandler) DeleteRecord(c *gin.Context)
DeleteRecord handles deleting a specific record by ID.
func (*RecordHandler) GetRecord ¶
func (h *RecordHandler) GetRecord(c *gin.Context)
GetRecord handles retrieving a single record by ID.
func (*RecordHandler) ListRecords ¶
func (h *RecordHandler) ListRecords(c *gin.Context)
ListRecords handles retrieving all records with filtering ---
func (*RecordHandler) UpdateRecord ¶
func (h *RecordHandler) UpdateRecord(c *gin.Context)
UpdateRecord handles updating an existing record.
type TableHandler ¶
type TableHandler struct {
MetaDB *sql.DB // Metadata DB pool (needed for path lookup)
Cfg *config.Config // App configuration (needed for?) - maybe not needed here directly
}
TableHandler holds dependencies for table management handlers.
func NewTableHandler ¶
func NewTableHandler(metaDB *sql.DB, cfg *config.Config) *TableHandler
NewTableHandler creates a new TableHandler.
func (*TableHandler) DeleteTable ¶
func (h *TableHandler) DeleteTable(c *gin.Context)
DeleteTable handles requests to drop a table within a specific user database.
func (*TableHandler) ListTablesFn ¶
func (h *TableHandler) ListTablesFn(c *gin.Context)
ListTables handles requests to list tables within a specific user database.