Documentation
¶
Overview ¶
Package router contains the handler for the database
Index ¶
- Constants
- func CORS() func(next http.Handler) http.Handler
- func MountRouter(handler DBHandler, cfg *configs.Config) (*http.ServeMux, error)
- func NewAPI(mux *http.ServeMux, cfg *configs.Config) huma.API
- func RegisterRoutes(api huma.API, h DBHandler)
- type BaseHTMLData
- type CreeteNewTableInput
- type DBHandler
- func (h DBHandler) CreeteNewTable(ctx context.Context, input *CreeteNewTableInput) (*struct{}, error)
- func (h DBHandler) DeleteRow(ctx context.Context, input *DeleteRowInput) (*struct{}, error)
- func (h *DBHandler) DeleteTable(ctx context.Context, input *struct{ Body DeleteTableRequest }) (*struct{}, error)
- func (h *DBHandler) HandleRunSQLQuery(ctx context.Context, input *RunSQLQueryInput) (*RunSQLQueryOutput, error)
- func (h DBHandler) InsertOrUpdateRow(ctx context.Context, input *InsertOrUpdateRowInput) (*struct{}, error)
- func (h DBHandler) ListColumns(ctx context.Context, input *ListColumnsInput) (*struct{ Body []models.ColValue }, error)
- func (h *DBHandler) ListHistory(ctx context.Context, input *ListHistoryInput) (*struct{ Body []models.History }, error)
- func (h *DBHandler) ListRecentHistory(ctx context.Context, input *struct{}) (*struct{ Body []models.History }, error)
- func (h DBHandler) ListRows(ctx context.Context, input *ListRowsInput) (*ListRowsOutput, error)
- func (h DBHandler) ListTables(ctx context.Context, input *struct{}) (*struct{ Body []models.ListTablesRow }, error)
- func (h DBHandler) NewTableFormFileds(ctx context.Context, input *struct{}) (*struct{ Body *service.FormDatatype }, error)
- func (h DBHandler) RowInsertOrUpdateForm(ctx context.Context, input *RowInsertOrUpdateFormInput) (*RowInsertOrUpdateFormOutput, error)
- type DeleteRowInput
- type DeleteTableRequest
- type ErrorMessage
- type InsertOrUpdateRowInput
- type ListColumnsInput
- type ListHistoryInput
- type ListRowsInput
- type ListRowsOutput
- type ListRowsResponse
- type RowInsertOrUpdateFormInput
- type RowInsertOrUpdateFormOutput
- type RunSQLQueryInput
- type RunSQLQueryOutput
Constants ¶
View Source
const ( GET methodType = "GET" POST methodType = "POST" PUT methodType = "PUT" DELETE methodType = "DELETE" )
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶ added in v0.1.7
Types ¶
type BaseHTMLData ¶
type BaseHTMLData struct {
Tables []models.ListTablesRow
Cols []models.ColValue
}
type CreeteNewTableInput ¶ added in v0.1.7
type DBHandler ¶
type DBHandler struct {
// contains filtered or unexported fields
}
func (DBHandler) CreeteNewTable ¶
func (h DBHandler) CreeteNewTable(ctx context.Context, input *CreeteNewTableInput) (*struct{}, error)
func (DBHandler) DeleteRow ¶
func (h DBHandler) DeleteRow(ctx context.Context, input *DeleteRowInput) (*struct{}, error)
func (*DBHandler) DeleteTable ¶
func (h *DBHandler) DeleteTable(ctx context.Context, input *struct{ Body DeleteTableRequest }) (*struct{}, error)
func (*DBHandler) HandleRunSQLQuery ¶ added in v0.1.7
func (h *DBHandler) HandleRunSQLQuery(ctx context.Context, input *RunSQLQueryInput) (*RunSQLQueryOutput, error)
func (DBHandler) InsertOrUpdateRow ¶
func (h DBHandler) InsertOrUpdateRow(ctx context.Context, input *InsertOrUpdateRowInput) (*struct{}, error)
func (DBHandler) ListColumns ¶
func (*DBHandler) ListHistory ¶
func (*DBHandler) ListRecentHistory ¶
func (DBHandler) ListRows ¶
func (h DBHandler) ListRows(ctx context.Context, input *ListRowsInput) (*ListRowsOutput, error)
func (DBHandler) ListTables ¶
func (DBHandler) NewTableFormFileds ¶
func (DBHandler) RowInsertOrUpdateForm ¶ added in v0.1.7
func (h DBHandler) RowInsertOrUpdateForm(ctx context.Context, input *RowInsertOrUpdateFormInput) (*RowInsertOrUpdateFormOutput, error)
type DeleteRowInput ¶ added in v0.1.7
type DeleteTableRequest ¶
type ErrorMessage ¶
type ErrorMessage struct {
Message string
}
type InsertOrUpdateRowInput ¶ added in v0.1.7
type ListColumnsInput ¶ added in v0.1.7
type ListColumnsInput struct {
TableName string `path:"tableName"`
}
type ListHistoryInput ¶ added in v0.1.7
type ListHistoryInput struct {
Page int `query:"page" default:"1"`
}
type ListRowsInput ¶ added in v0.1.7
type ListRowsOutput ¶ added in v0.1.7
type ListRowsOutput struct {
Body ListRowsResponse
}
type ListRowsResponse ¶
type RowInsertOrUpdateFormInput ¶ added in v0.1.7
type RowInsertOrUpdateFormOutput ¶ added in v0.1.7
type RunSQLQueryInput ¶ added in v0.1.7
type RunSQLQueryInput struct {
Body struct {
Query string `json:"query"`
}
}
type RunSQLQueryOutput ¶ added in v0.1.7
type RunSQLQueryOutput struct {
Body struct {
*models.RunSQLQueryOutput
}
}
Click to show internal directories.
Click to hide internal directories.