serializer

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package serializer ...

Index

Constants

This section is empty.

Variables

View Source
var DirPathRegex = regexp.MustCompile(`^(/[\p{Han}\sA-Za-z0-9_-]+)*/$`)

DirPathRegex 对象存储目录名称正则

View Source
var ObjNameRegex = regexp.MustCompile(`^[\p{Han}\sA-Za-z0-9._-]+(\.[A-Za-z0-9._-]+)*$`)

ObjNameRegex 对象存储文件名称正则

Functions

This section is empty.

Types

type CreateDirRequest

type CreateDirRequest struct {
	DirPath string `form:"dirPath" binding:"required"`
}

CreateDirRequest ...

func (*CreateDirRequest) Validate

func (r *CreateDirRequest) Validate(c *gin.Context) error

Validate ...

type DeleteDirRequest

type DeleteDirRequest = CreateDirRequest

DeleteDirRequest ...

type DeleteObjectRequest

type DeleteObjectRequest = DownloadObjectRequest

DeleteObjectRequest ...

type DownloadObjectRequest

type DownloadObjectRequest struct {
	DirPath string `form:"dirPath"`
	ObjName string `form:"objName"`
}

DownloadObjectRequest ...

func (*DownloadObjectRequest) Validate

func (r *DownloadObjectRequest) Validate(c *gin.Context) error

Validate ...

type ListObjectsRequest

type ListObjectsRequest = CreateDirRequest

ListObjectsRequest ...

type ListObjectsResponse

type ListObjectsResponse struct {
	Name      string `json:"name"`
	IsDir     bool   `json:"isDir"`
	Size      int64  `json:"size"`
	SHA256    string `json:"sha256"`
	UpdatedAt string `json:"updatedAt"`
}

ListObjectsResponse ...

type UploadObjectRequest

type UploadObjectRequest struct {
	File    *multipart.FileHeader `form:"file"`
	DirPath string                `form:"dirPath"`
}

UploadObjectRequest ...

func (*UploadObjectRequest) Validate

func (r *UploadObjectRequest) Validate(c *gin.Context) error

Validate ...

Jump to

Keyboard shortcuts

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