Documentation
¶
Index ¶
- func HealthCheck(c *fiber.Ctx) error
- func SetupHealthRoutes(app *fiber.App)
- func SetupRoutes(app *fiber.App, cfg *config.Config, store storage.Storage, ...)
- type Conversion
- type FileHeader
- type Handler
- func (h *Handler) AdminDashboard(c *fiber.Ctx) error
- func (h *Handler) ConvertFile(c *fiber.Ctx) error
- func (h *Handler) DeleteConversion(c *fiber.Ctx) error
- func (h *Handler) DeleteUser(c *fiber.Ctx) error
- func (h *Handler) DownloadFile(c *fiber.Ctx) error
- func (h *Handler) GetConversion(c *fiber.Ctx) error
- func (h *Handler) GetConversionStatus(c *fiber.Ctx) error
- func (h *Handler) GetSettings(c *fiber.Ctx) error
- func (h *Handler) GetStats(c *fiber.Ctx) error
- func (h *Handler) GetUser(c *fiber.Ctx) error
- func (h *Handler) HealthCheck(c *fiber.Ctx) error
- func (h *Handler) ListConversions(c *fiber.Ctx) error
- func (h *Handler) ListUsers(c *fiber.Ctx) error
- func (h *Handler) Login(c *fiber.Ctx) error
- func (h *Handler) RefreshToken(c *fiber.Ctx) error
- func (h *Handler) Register(c *fiber.Ctx) error
- func (h *Handler) UpdateSettings(c *fiber.Ctx) error
- func (h *Handler) UpdateUser(c *fiber.Ctx) error
- type HealthResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthCheck ¶
func HealthCheck(c *fiber.Ctx) error
HealthCheck handles the health check endpoint @Summary Health check @Description Check if the service is running @Tags health @Accept json @Produce json @Success 200 {object} HealthResponse @Router /health [get]
func SetupHealthRoutes ¶
func SetupHealthRoutes(app *fiber.App)
SetupHealthRoutes configures health check routes
func SetupRoutes ¶
func SetupRoutes(app *fiber.App, cfg *config.Config, store storage.Storage, conv *factory.ConverterFactory, logger *slog.Logger)
SetupRoutes configures all the routes for the application
Types ¶
type Conversion ¶
type Conversion struct { ID string `json:"id"` Status string `json:"status"` SourceFormat string `json:"source_format"` TargetFormat string `json:"target_format"` OriginalName string `json:"original_name"` ConvertedName string `json:"converted_name,omitempty"` FileSize int64 `json:"file_size"` CreatedAt time.Time `json:"created_at"` CompletedAt time.Time `json:"completed_at,omitempty"` DownloadURL string `json:"download_url,omitempty"` Error string `json:"error,omitempty"` }
Conversion represents a file conversion @Description File conversion details
type FileHeader ¶
type FileHeader struct {
*multipart.FileHeader
}
FileHeader wraps multipart.FileHeader to implement our interface
func (*FileHeader) Filename ¶
func (f *FileHeader) Filename() string
Filename returns the name of the file
func (*FileHeader) Open ¶
func (f *FileHeader) Open() (multipart.File, error)
Open returns a ReadCloser for the file
func (*FileHeader) Size ¶
func (f *FileHeader) Size() int64
Size returns the size of the file in bytes
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler provides application handlers
func NewHandler ¶
func NewHandler(cfg *config.Config, store storage.Storage, factory *factory.ConverterFactory, log *slog.Logger) *Handler
NewHandler creates a new handler instance
func (*Handler) AdminDashboard ¶
AdminDashboard returns admin dashboard stats
func (*Handler) ConvertFile ¶
ConvertFile handles file conversion requests @Summary Convert a file to another format @Description Converts an uploaded file to the specified target format @Tags files @Accept multipart/form-data @Produce json @Param file formData file true "File to convert" @Param format formData string true "Target format to convert to" @Success 200 {object} map[string]interface{} @Failure 400 {object} map[string]interface{} @Failure 500 {object} map[string]interface{} @Router /api/v1/convert [post]
func (*Handler) DeleteConversion ¶
DeleteConversion deletes a conversion @Summary Delete conversion @Description Deletes a file conversion by ID @Tags conversion @Param id path string true "Conversion ID" @Success 204 @Failure 404 {object} map[string]interface{} @Router /api/v1/convert/{id} [delete]
func (*Handler) DeleteUser ¶
DeleteUser deletes a user
func (*Handler) DownloadFile ¶
DownloadFile downloads a converted file @Summary Download converted file @Description Downloads a converted file by ID @Tags conversion @Produce octet-stream @Param id path string true "Conversion ID" @Success 200 @Failure 404 {object} map[string]interface{} @Router /api/v1/convert/{id}/download [get]
func (*Handler) GetConversion ¶
GetConversion gets a single conversion by ID @Summary Get conversion @Description Gets a file conversion by ID @Tags conversion @Produce json @Param id path string true "Conversion ID" @Success 200 {object} Conversion @Failure 404 {object} map[string]interface{} @Router /api/v1/convert/{id} [get]
func (*Handler) GetConversionStatus ¶
GetConversionStatus gets the status of a conversion @Summary Get conversion status @Description Gets the status of a file conversion by ID @Tags conversion @Produce json @Param id path string true "Conversion ID" @Success 200 {object} Conversion @Failure 404 {object} map[string]interface{} @Router /api/v1/convert/{id}/status [get]
func (*Handler) GetSettings ¶
GetSettings returns system settings
func (*Handler) HealthCheck ¶
HealthCheck handles health check requests
func (*Handler) ListConversions ¶
ListConversions lists all conversions @Summary List conversions @Description Lists all file conversions @Tags conversion @Produce json @Success 200 {array} Conversion @Router /api/v1/convert [get]
func (*Handler) RefreshToken ¶
RefreshToken handles token refresh
func (*Handler) UpdateSettings ¶
UpdateSettings updates system settings
func (*Handler) UpdateUser ¶
UpdateUser updates a user
type HealthResponse ¶
type HealthResponse struct { Status string `json:"status"` Version string `json:"version"` Uptime string `json:"uptime,omitempty"` }
HealthResponse represents the health check response structure