handler

package
v0.0.0-...-3afac47 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChunkMaxSize = 100 << 20 // 分片上传最大 100MB
)

Variables

This section is empty.

Functions

func CreateHTTPHandler

func CreateHTTPHandler(s *server.Server) http.Handler

func NewAuthHandler

func NewAuthHandler() *authHandler

func NewDownloadHandler

func NewDownloadHandler(u uploader.Uploader) *downloadHandler

func NewFileHandler

func NewFileHandler() *fileHandler

func NewFolderHandler

func NewFolderHandler(client *nosclient.NosClient, bucketName string) *folderHandler

func NewGroupHandler

func NewGroupHandler() *groupHandler

func NewMeHandler

func NewMeHandler(imageUrl image_url.URL) *meHandler

func NewUploadFileHandler

func NewUploadFileHandler(u go_file_uploader.Uploader) *uploadFile

func NewUploadImage

func NewUploadImage(u image_uploader.Uploader, imageUrl image_url.URL) *uploadImage

func NewUserHandler

func NewUserHandler(imageUrl image_url.URL) *userHandler

Types

type FolderData

type FolderData struct {
	Filename string
	Key      string
}

type FormData

type FormData struct {
	FolderId    int64  `json:"folder_id" form:"folder_id"`
	ChunkIndex  int    `json:"chunk_index" form:"chunk_index"`
	TotalChunk  int    `json:"total_chunk" form:"total_chunk"`
	TotalSize   int64  `json:"total_size" form:"total_size"`
	FileHash    string `json:"file_hash" form:"file_hash"`
	IsLastChunk bool   `json:"is_last_chunk" form:"is_last_chunk"`
	Filename    string `json:"filename" form:"filename"`
	UploadId    string `json:"upload_id" form:"upload_id"`
}

type UploadResponse

type UploadResponse struct {
	UploadId   string `json:"upload_id"`
	ChunkIndex int    `json:"chunk_index"`
	FileHash   string `json:"file_hash"`
	StatusCode int    `json:"status_code"`
	Message    string `json:"message"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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