Documentation ¶
Overview ¶
tracker models
Index ¶
- Constants
- Variables
- type BlockStorage
- type File
- type FileHash
- type FileMeta
- type Group
- func (d Group) GetDB() string
- func (d Group) GetID() string
- func (g Group) GetLongLivedStorage() (storage Storage)
- func (g Group) GetMinDelayStorage() *Storage
- func (g Group) GetStorageByHash(c *gin.Context) (*Storage, error)
- func (g Group) GetSyncStorages(master *Storage) []Storage
- func (g Group) GetValidStorages() (storages []Storage)
- type Link
- type MLink
- type Storage
- type SyncDst
- type SyncSession
- type System
- type UploadSession
Constants ¶
View Source
const StorageFileDb = "tracker_file_db"
StorageFileDb
Variables ¶
View Source
var FileHashDB = "file_hash_db"
View Source
var GroupDB = "group_db"
GroupDB
View Source
var LinkDB = "link_db"
LinkDB
View Source
var UploadSessionDB = "upload_session_db"
k : block md5 , v :
Functions ¶
This section is empty.
Types ¶
type BlockStorage ¶
func (BlockStorage) GetDB ¶
func (BlockStorage) GetDB() string
func (BlockStorage) GetID ¶
func (b BlockStorage) GetID() string
type File ¶
type File struct { ID string `json:"id"` PreID string `json:"pre_id"` FileMeta `json:"file_meta"` Storage *Storage `json:"storage"` Backups []Storage `json:"backups"` Name string `json:"name"` // 0: 正在上传 1:上传完成 -1:已经删除 Status int `json:"status"` Path string `json:"path"` BlockSize int64 `json:"block_size"` BlockMd5 []string `json:"block_md5"` Dir bool `json:"dir"` Link *Link `json:"link"` UpdataTime int64 `json:"updata_time"` }
File
type Group ¶
type Group struct { Name string `json:"name"` Cap int64 `json:"cap"` Status string `json:"status"` Storages map[string]Storage `json:"storages"` }
Group
func (Group) GetLongLivedStorage ¶
func (Group) GetMinDelayStorage ¶ added in v0.7.5
func (Group) GetStorageByHash ¶ added in v0.7.5
func (Group) GetSyncStorages ¶ added in v0.7.5
func (Group) GetValidStorages ¶
type Link ¶
type Link struct { Scheme string `json:"scheme"` Path string `json:"path"` Header http.Header `json:"header"` // needed header Data io.ReadCloser // return file reader directly Expiration *time.Duration // url expiration time }
k : filemetaID v : Link
type MLink ¶
type MLink struct { Scheme string Path string Header http.Header `json:"header"` // needed header ExpriedAt time.Time }
MLink
type Storage ¶
type Storage struct { Group string `json:"group"` ServerAddr string `json:"server_addr"` DownloadAddr string `json:"download_addr"` // work is good else is err info Status string `json:"status"` Cap int64 `json:"cap"` Delay int64 `json:"delay"` UpdataTime int64 `json:"updata_time"` }
Storage
type SyncSession ¶ added in v0.7.5
type SyncSession struct { ID string `json:"id"` Src *Storage `json:"src"` Dst []SyncDst `json:"dst"` FID string `json:"fid"` // 等待同步 ;正在同步;异常 Status string `json:"status"` CreatedAt int64 `json:"ctreated_at"` BeginAt int64 `json:"begin_at"` UpdataAt int64 `json:"upldata_at"` }
func (SyncSession) GetDB ¶ added in v0.7.5
func (s SyncSession) GetDB() string
func (SyncSession) GetID ¶ added in v0.7.5
func (s SyncSession) GetID() string
func (SyncSession) GetTargets ¶ added in v0.7.5
func (s SyncSession) GetTargets() []string
type UploadSession ¶
type UploadSession struct { ID string `json:"id"` FileID string `json:"file_id"` CreatedTime int64 `json:"cteated_time"` UpdataTime int64 `json:"update_time"` Status string `json:"status"` BlockSize int64 `json:"block_size"` Percent float32 `json:"percent"` }
UploadSession
func (UploadSession) GetDB ¶
func (d UploadSession) GetDB() string
func (UploadSession) GetID ¶
func (d UploadSession) GetID() string
func (*UploadSession) GetPercent ¶
func (u *UploadSession) GetPercent() (float32, error)
func (*UploadSession) GetStatus ¶
func (u *UploadSession) GetStatus() string
Click to show internal directories.
Click to hide internal directories.