handlers

package
v0.0.0-...-d906159 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_FILE_SIZE = 1024 * 1024 * 10 // 10MB
	CACHE_NS      = "alya"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RespondJson

type RespondJson struct {
	Status  bool        `json:"status"`
	Intent  string      `json:"intent"`
	Message interface{} `json:"message"`
}

type UploadService

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

UploadService is a struct for auth core

func NewUploadService

func NewUploadService(
	inAppCache *persistence.InMemoryStore,
) *UploadService

func (*UploadService) HandleGetFileByCode

func (us *UploadService) HandleGetFileByCode(c *gin.Context)

RetrieveFile godoc @Summary retrieve uploaded file by temp code @Schemes @Description retrieve uploaded file by temp code @Tags Upload @Accept */* @Param code path string true "code" @Produce */* @Success 200 {object} string "file itself" @Failure 404 {object} handlers.RespondJson "File expired or not found" @Failure 500 {object} handlers.RespondJson "Internal Server Error" @Router /f/{code} [get]

func (*UploadService) HandleUiIndex

func (us *UploadService) HandleUiIndex(c *gin.Context)

func (*UploadService) HandleUploadFile

func (us *UploadService) HandleUploadFile(ctx *gin.Context) (int, interface{}, error)

UploadFile godoc @Summary upload temporary file @Schemes @Description upload temporary file @Tags Upload @Accept multipart/form-data @Param file formData file true "file" @Produce */* @Success 200 {object} string "uploaded file temp code" @Failure 401 {object} handlers.RespondJson "Unauthorized" @Failure 403 {object} handlers.RespondJson "Forbidden" @Failure 500 {object} handlers.RespondJson "Internal Server Error" @Router /upload [post]

func (*UploadService) InitRouter

func (us *UploadService) InitRouter(r *gin.Engine)

func (*UploadService) InitUploadsOldFileCleaner

func (us *UploadService) InitUploadsOldFileCleaner()

Jump to

Keyboard shortcuts

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