handler

package
v0.0.0-...-559ba26 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MinLength = 200
View Source
const SecretCodeCookieTTL = 30 * 24 * time.Hour
View Source
const SecretCodeKey = "code"

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONError

type JSONError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type PepicHandler

type PepicHandler struct {
	Processing processing.Processing
	Storage    storage.Storage
}

func (*PepicHandler) ErrorHandler

func (h *PepicHandler) ErrorHandler(err error, c echo.Context)

func (*PepicHandler) GetMeta

func (h *PepicHandler) GetMeta(c echo.Context) error

GET /meta/:name Render HTML page with uploaded images/videos and pre-defined templates for them

func (*PepicHandler) GetOriginalFile

func (h *PepicHandler) GetOriginalFile(c echo.Context) error

GET /:name Returns originally stored file

func (*PepicHandler) GetResizedFile

func (h *PepicHandler) GetResizedFile(c echo.Context) error

GET /:length/:name Resizes the file, stores and returns it

func (*PepicHandler) Index

func (h *PepicHandler) Index(c echo.Context) error

GET / Index page Shows a form for uploading a file or entering a secret code (if configured)

func (*PepicHandler) UploadBodyBytes

func (h *PepicHandler) UploadBodyBytes(c echo.Context) error

POST /upload/bytes/ Handles raw bytes upload from body

func (*PepicHandler) UploadMultipart

func (h *PepicHandler) UploadMultipart(c echo.Context) error

POST /upload/multipart/ Handles multipart upload

type UploadResult

type UploadResult struct {
	Filename string `json:"filename"`
	Url      string `json:"url"`
}

Jump to

Keyboard shortcuts

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