api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_FILE_SIZE = 10 << 20
)

Variables

View Source
var SUPPORTED_IMAGE_TYPES = map[string]bool{
	".jpg":  true,
	".jpeg": true,
	".png":  true,
}

Functions

func ApplySepia

func ApplySepia(img image.Image) image.Image

func NewUserResponse

func NewUserResponse(user db.User) userResponse

func StringToUUID

func StringToUUID(value string) (pgtype.UUID, error)

Types

type CreateUserRequest

type CreateUserRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config *config.Config, conn *pgx.Conn) (*Server, error)

func (*Server) SetupRoutes

func (server *Server) SetupRoutes() *gin.Engine

func (*Server) Start

func (server *Server) Start() error

type TransformRequest

type TransformRequest struct {
	Transformations struct {
		Resize *struct {
			Width  int `json:"width"`
			Height int `json:"height"`
		} `json:"resize"`
		Crop *struct {
			Width  int `json:"width"`
			Height int `json:"height"`
			X      int `json:"x"`
			Y      int `json:"y"`
		} `json:"crop"`
		Rotate  *float64 `json:"rotate"`
		Format  *string  `json:"format"`
		Filters *struct {
			Grayscale bool `json:"grayscale"`
			Sepia     bool `json:"sepia"`
		} `json:"filters"`
	} `json:"transformations"`
}

Jump to

Keyboard shortcuts

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