Documentation ¶
Index ¶
- Constants
- Variables
- func CountF() (int, error)
- func CountFile() (int, error)
- func CountFileExt(oid, owner, name string, pid, status []string) (extCount []util.Map, err error)
- func DoAddTask(rf *F) (int, error)
- func DoAddTaskRemote(rf *F) error
- func FOI_F(rf *F) (int, error)
- func FOI_File(file *File) (int, error)
- func IsExternalSupported(ext string) bool
- func ListF_m(ids []string) (map[string]*F, error)
- func ListTaskIds() ([]string, error)
- func MapVal(v interface{}) (util.Map, bool)
- func MapValV(v interface{}) interface{}
- func RemoveFile(id ...string) (removed int, err error)
- func SyncAllTask(exts []string) (total int, err error)
- func SyncAllTaskV(exts, ignore []string) (total int, err error)
- func SyncTask(exts, ignore []string, limit int) (int, error)
- func UpdateExecF(id, es string) error
- func UpdateF(id string, set bson.M) error
- func UpdateFile(file *File) error
- func UpdateFileParent(fids []string, pid string) error
- func UpdateVerifyF(id, es string) error
- func VerifyVideo(diri, diro string, exts, ids, ignore []string) (total, fail int, err error)
- func VerifyVideoF(diri, diro string, rf *F) (int, error)
- type F
- func FindF(id string) (*F, error)
- func FindFv(query bson.M) (*F, error)
- func FindHashF(sha, md5 string) (*F, error)
- func FindMarkF(mark string) (*F, error)
- func FindPubF(pub string) (*F, error)
- func ListF(ids []string) ([]*F, error)
- func ListFv(query bson.M) ([]*F, error)
- func ListHashF(sha, md5 []string) ([]*F, error)
- func ListMarkF(mark []string) ([]*F, error)
- func ListMarkFv(mark []string) ([]*F, map[string]string, error)
- func ListPubF(pub []string) ([]*F, error)
- func ListShaF(sha []string) ([]*F, error)
- type FFCM_H
- type File
- type Mark
Constants ¶
View Source
const ( CN_F = "c_f" CN_MARK = "c_mark" CN_FILE = "c_file" CN_FOLDER = "c_folder" )
View Source
const ( ES_RUNNING = "running" ES_DONE = "done" ES_ERROR = "error" ES_IGNORE = "ignore" ES_NONE = "none" // VS_VERIFIED = "verified" VS_ZERO = "zero" VS_REDO = "redo" VS_ERROR = "error" )
View Source
const ( FS_N = "N" //normal FS_D = "D" //deleted )
View Source
const ( FT_FILE = "file" FT_FOLDER = "folder" )
Variables ¶
View Source
var C = func(n string) *mgo.Collection { panic("the gfs database caller is not initial") }
View Source
var CreateOutPath = func(f *F) string { if len(f.Path) < 1 { return "" } var out = OutPathPre + strings.TrimSuffix(f.Path, filepath.Ext(f.Path)) if f.Path == out { return out + "_" } else { return out } }
View Source
var ExternalExecSupported = []string{}
View Source
var Indexes = map[string]map[string]mgo.Index{ CN_F: map[string]mgo.Index{ "f_name": mgo.Index{ Key: []string{"name"}, }, "f_filename": mgo.Index{ Key: []string{"filename"}, }, "f_pub": mgo.Index{ Key: []string{"pub"}, }, "f_sha": mgo.Index{ Key: []string{"sha"}, }, "f_md5": mgo.Index{ Key: []string{"md5"}, }, "f_ext": mgo.Index{ Key: []string{"ext"}, }, "f_size": mgo.Index{ Key: []string{"size"}, }, "f_type": mgo.Index{ Key: []string{"type"}, }, "f_exec": mgo.Index{ Key: []string{"exec"}, }, "f_status": mgo.Index{ Key: []string{"status"}, }, "f_time": mgo.Index{ Key: []string{"time"}, }, }, }
View Source
var MockStartTaskErr int = 0
View Source
var OutPathPre = ""
View Source
var ShowLog = 0
Functions ¶
func CountFileExt ¶
func DoAddTaskRemote ¶
func IsExternalSupported ¶
func ListTaskIds ¶
func RemoveFile ¶
func SyncAllTask ¶
func SyncAllTaskV ¶
func UpdateExecF ¶
func UpdateFile ¶
func UpdateFileParent ¶
func UpdateVerifyF ¶
func VerifyVideo ¶
Types ¶
type F ¶
type F struct { Id string `bson:"_id" json:"id"` Name string `bson:"name" json:"name"` Filename string `bson:"filename" json:"filename"` //upload file name Pub string `bson:"pub" json:"pub"` //public path. SHA string `bson:"sha" json:"sha"` //file sha MD5 string `bson:"md5" json:"md5"` //file md5 EXT string `bson:"ext" json:"ext"` //file externd Size int64 `bson:"size" json:"size"` //file size. Type string `bson:"type" json:"type"` //mimetype Path string `bson:"path" json:"-"` //file save path. Exec string `bson:"exec" json:"exec"` //the exec status Info util.Map `bson:"info" json:"info"` //the extern info. Status string `bson:"status" json:"status"` //file status Time int64 `bson:"time" json:"time"` //upload time. }
type File ¶
type File struct { Id string `bson:"_id" json:"id"` Fid string `bson:"fid" json:"fid"` Pid string `bson:"pid" json:"pid"` Oid string `bson:"oid" json:"oid"` Owner string `bson:"owner" json:"owner"` Name string `bson:"name" json:"name"` EXT string `bson:"ext" json:"ext"` //file externd Type string `bson:"type" json:"type"` //type Tags []string `bson:"tags" json:"tags"` Desc string `bson:"desc" json:"desc"` Status string `bson:"status" json:"status"` //file status Time int64 `bson:"time" json:"time"` //upload time. }
Click to show internal directories.
Click to hide internal directories.