handlers

package
v0.0.0-...-c0f13c9 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLimit = 100
	MaxLimit     = 1000
)

Variables

This section is empty.

Functions

func RegisterSyncRoutes

func RegisterSyncRoutes(router *gin.Engine, database *bun.DB)

Types

type BeginUploadResponse

type BeginUploadResponse struct {
	UploadID       string `json:"upload_id"`
	TotalChunks    int    `json:"total_chunks"`
	ChunkSize      int64  `json:"chunk_size"`
	UploadedChunks []int  `json:"uploaded_chunks"`
	Message        string `json:"message,omitempty"`
}

type ChangesResponse

type ChangesResponse struct {
	Version string             `json:"version"`
	Changes []*model.ChangeLog `json:"changes"`
	Changed int                `json:"changed"`
	Message string             `json:"message,omitempty"`
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

type FileInfoResponse

type FileInfoResponse struct {
	Exists  bool              `json:"exists"`
	Info    *model.FileObject `json:"info,omitempty"`
	Message string            `json:"message,omitempty"`
}

type FinalizeUploadResponse

type FinalizeUploadResponse struct {
	Etag    string `json:"etag"`
	Size    int64  `json:"size"`
	Message string `json:"message,omitempty"`
}

type ListDirectoryResponse

type ListDirectoryResponse struct {
	Items   []*model.FileObject `json:"items"`
	Total   int64               `json:"total"`
	Offset  int                 `json:"offset"`
	Limit   int                 `json:"limit"`
	HasMore bool                `json:"has_more"`
	Message string              `json:"message,omitempty"`
}

type SyncHandler

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

func NewSyncHandler

func NewSyncHandler(database *bun.DB) *SyncHandler

func (*SyncHandler) BeginUpload

func (h *SyncHandler) BeginUpload(c *gin.Context)

func (*SyncHandler) CancelUpload

func (h *SyncHandler) CancelUpload(c *gin.Context)

func (*SyncHandler) Copy

func (h *SyncHandler) Copy(c *gin.Context)

func (*SyncHandler) CreateDirectory

func (h *SyncHandler) CreateDirectory(c *gin.Context)

func (*SyncHandler) Delete

func (h *SyncHandler) Delete(c *gin.Context)

func (*SyncHandler) DownloadFile

func (h *SyncHandler) DownloadFile(c *gin.Context)

func (*SyncHandler) FinalizeUpload

func (h *SyncHandler) FinalizeUpload(c *gin.Context)

func (*SyncHandler) GetCurrentVersion

func (h *SyncHandler) GetCurrentVersion(c *gin.Context)

func (*SyncHandler) GetFileInfo

func (h *SyncHandler) GetFileInfo(c *gin.Context)

func (*SyncHandler) GetSyncStatus

func (h *SyncHandler) GetSyncStatus(c *gin.Context)

func (*SyncHandler) ListChanges

func (h *SyncHandler) ListChanges(c *gin.Context)

func (*SyncHandler) ListDirectory

func (h *SyncHandler) ListDirectory(c *gin.Context)

func (*SyncHandler) Move

func (h *SyncHandler) Move(c *gin.Context)

func (*SyncHandler) UploadChunk

func (h *SyncHandler) UploadChunk(c *gin.Context)

func (*SyncHandler) UploadFile

func (h *SyncHandler) UploadFile(c *gin.Context)

type SyncStatusResponse

type SyncStatusResponse struct {
	Status  string            `json:"status"`
	Info    *model.FileObject `json:"info,omitempty"`
	Message string            `json:"message,omitempty"`
}

type UploadResponse

type UploadResponse struct {
	Etag    string `json:"etag"`
	Version string `json:"version"`
	Size    int64  `json:"size"`
	Message string `json:"message,omitempty"`
}

type VersionResponse

type VersionResponse struct {
	Version   string    `json:"version"`
	Vector    string    `json:"vector"`
	Timestamp time.Time `json:"timestamp"`
}

Jump to

Keyboard shortcuts

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