server

package
v0.0.0-...-447df18 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: MIT Imports: 35 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package server handles starting the HTTP server and routing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer() *http.Server

Types

type ImagePair

type ImagePair struct {
	OriginalURL string
	LowResURL   string
}

type ImageUpload

type ImageUpload struct {
	File   multipart.File
	Header *multipart.FileHeader
}

type PasswordResetConfirmReq

type PasswordResetConfirmReq struct {
	NewPassword string `json:"newPassword" binding:"required"`
	OTP         string `json:"otp"         binding:"required"`
	Email       string `json:"email"       binding:"required"`
}

type ReviewReq

type ReviewReq struct {
	Rating    int    `json:"rating"    binding:"required,min=0,max=5"`
	Review    string `json:"review"    binding:"min=8"`
	ProductID int    `json:"productId" binding:"required"`
}

type Server

type Server struct {
	DB    database.Service
	Env   *config.Env
	S3    s3.S3
	Email auth.EmailSender
	// contains filtered or unexported fields
}

func (*Server) GetSizes

func (s *Server) GetSizes(ctx *gin.Context)

func (*Server) RegisterRoutes

func (s *Server) RegisterRoutes() http.Handler

func (*Server) UploadImageWithLowRes

func (s *Server) UploadImageWithLowRes(
	c *gin.Context,
	file multipart.File,
	header *multipart.FileHeader,
	targetWidth int,
) (*ImagePair, *utils.APIError)

Jump to

Keyboard shortcuts

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