fileshdr

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: LGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgTypeSha1     = "sha1"
	MsgTypeIndexing = "indexing"
)
View Source
const (
	// queries
	FilePathQuery = "fp"
	ListDirQuery  = "dp"
	ShareIDQuery  = "shid"
	Keyword       = "k"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateReq

type CreateReq struct {
	Path     string `json:"path"`
	FileSize int64  `json:"fileSize"`
}

type FileHandlers

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

func NewFileHandlers

func NewFileHandlers(cfg gocfg.ICfg, deps *depidx.Deps) (*FileHandlers, error)

func (*FileHandlers) AddSharing

func (h *FileHandlers) AddSharing(c *gin.Context)

func (*FileHandlers) Copy

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

func (*FileHandlers) CopyDir

func (h *FileHandlers) CopyDir(c *gin.Context)

func (*FileHandlers) Create

func (h *FileHandlers) Create(c *gin.Context)

func (*FileHandlers) DelSharing

func (h *FileHandlers) DelSharing(c *gin.Context)

func (*FileHandlers) DelUploading

func (h *FileHandlers) DelUploading(c *gin.Context)

func (*FileHandlers) Delete

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

func (*FileHandlers) Download

func (h *FileHandlers) Download(c *gin.Context)

TODO: support ETag

func (*FileHandlers) GenerateHash

func (h *FileHandlers) GenerateHash(c *gin.Context)

func (*FileHandlers) GetSharingDir added in v0.5.0

func (h *FileHandlers) GetSharingDir(c *gin.Context)

func (*FileHandlers) GetStreamReader

func (h *FileHandlers) GetStreamReader(userID uint64, fd io.Reader) (io.ReadCloser, error)

func (*FileHandlers) IsSharing

func (h *FileHandlers) IsSharing(c *gin.Context)

func (*FileHandlers) List

func (h *FileHandlers) List(c *gin.Context)

func (*FileHandlers) ListHome

func (h *FileHandlers) ListHome(c *gin.Context)

func (*FileHandlers) ListSharingIDs added in v0.5.0

func (h *FileHandlers) ListSharingIDs(c *gin.Context)

func (*FileHandlers) ListSharings deprecated

func (h *FileHandlers) ListSharings(c *gin.Context)

Deprecated: use ListSharingIDs instead

func (*FileHandlers) ListUploadings

func (h *FileHandlers) ListUploadings(c *gin.Context)

func (*FileHandlers) MergeFileInfos

func (h *FileHandlers) MergeFileInfos(ctx *gin.Context, dirPath string, infos []os.FileInfo) ([]*MetadataResp, error)

func (*FileHandlers) Metadata

func (h *FileHandlers) Metadata(c *gin.Context)

func (*FileHandlers) Mkdir

func (h *FileHandlers) Mkdir(c *gin.Context)

func (*FileHandlers) Move

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

func (*FileHandlers) Reindex added in v0.9.1

func (h *FileHandlers) Reindex(c *gin.Context)

func (*FileHandlers) SearchItems added in v0.9.1

func (h *FileHandlers) SearchItems(c *gin.Context)

func (*FileHandlers) UploadChunk

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

func (*FileHandlers) UploadStatus

func (h *FileHandlers) UploadStatus(c *gin.Context)

type GenerateHashReq

type GenerateHashReq struct {
	FilePath string `json:"filePath"`
}

type GetSharingDirResp added in v0.5.0

type GetSharingDirResp struct {
	SharingDir string `json:"sharingDir"`
}

type IndexingParams added in v0.9.1

type IndexingParams struct{}

type ListResp

type ListResp struct {
	Cwd       string          `json:"cwd"`
	Metadatas []*MetadataResp `json:"metadatas"`
}

type ListUploadingsResp

type ListUploadingsResp struct {
	UploadInfos []*db.UploadInfo `json:"uploadInfos"`
}

type MetadataResp

type MetadataResp struct {
	Name    string    `json:"name"`
	Size    int64     `json:"size"`
	ModTime time.Time `json:"modTime"`
	IsDir   bool      `json:"isDir"`
	Sha1    string    `json:"sha1"`
}

type MkdirReq

type MkdirReq struct {
	Path string `json:"path"`
}

type MoveReq

type MoveReq struct {
	OldPath string `json:"oldPath"`
	NewPath string `json:"newPath"`
}

type SearchItemsResp added in v0.9.1

type SearchItemsResp struct {
	Results []string `json:"results"`
}

type Sha1Params

type Sha1Params struct {
	FilePath string
	UserId   uint64
}

type SharingIDsResp added in v0.5.0

type SharingIDsResp struct {
	IDs map[string]string `json:"IDs"`
}

type SharingReq

type SharingReq struct {
	SharingPath string `json:"sharingPath"`
}

type SharingResp

type SharingResp struct {
	SharingDirs []string `json:"sharingDirs"`
}

type UploadChunkReq

type UploadChunkReq struct {
	Path    string `json:"path"`
	Content string `json:"content"`
	Offset  int64  `json:"offset"`
}

type UploadStatusResp

type UploadStatusResp struct {
	Path     string `json:"path"`
	IsDir    bool   `json:"isDir"`
	FileSize int64  `json:"fileSize"`
	Uploaded int64  `json:"uploaded"`
}

Jump to

Keyboard shortcuts

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