Documentation
¶
Index ¶
- func NextPage(page, perPage, total int64) (int64, int64)
- func Pagination(page, perPage int) (int, int)
- func Random(db *xorm.Engine, data interface{}, n int, table string) (err error)
- func Range(db *xorm.Session, data interface{}, page, perPage int, where string, ...) (int64, error)
- func SyncFileCreate(sf *SyncFile)
- func SyncFileDelete(where string, a ...interface{})
- func SyncFileEach(fn func(sf SyncFile))
- func SyncFileUpdate(sf *SyncFile, where string, a ...interface{})
- func SyncFileUpdateMap(sf map[string]interface{}, where string, a ...interface{})
- func TaskInsert(db *xorm.Engine, task *Task) error
- func TaskPut(db *xorm.Engine, id string, task map[string]interface{}) error
- type JsonTime
- type SyncFile
- type Task
- type TaskStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Pagination ¶
func SyncFileCreate ¶
func SyncFileCreate(sf *SyncFile)
func SyncFileDelete ¶
func SyncFileDelete(where string, a ...interface{})
func SyncFileEach ¶
func SyncFileEach(fn func(sf SyncFile))
func SyncFileUpdate ¶
func SyncFileUpdateMap ¶
Types ¶
type JsonTime ¶
func (JsonTime) MarshalJSON ¶
type SyncFile ¶
type SyncFile struct {
Id int64 `json:"id"`
CreatedAt JsonTime `json:"created" xorm:"created"`
UpdatedAt JsonTime `json:"updated" xorm:"updated"`
Crc64ecma string `json:"crc64_ecma" xorm:"varchar(100) notnull index 'crc64_ecma'"`
Md5 string `json:"md5"`
Name string `json:"name"`
Path string `json:"path" xorm:"varchar(100) notnull index 'path'"`
PathHash string `json:"path_hash" xorm:"varchar(100) notnull unique 'path_hash'"`
Changed bool `json:"changed"`
Synced bool `json:"synced"`
Size int64 `json:"size"`
Mode os.FileMode `json:"mode"`
ModTime int64 `json:"mod_time"`
IsDir bool `json:"-"`
}
func SyncFileFindOne ¶
type Task ¶
type Task struct {
Id int64 `json:"id"`
CreatedAt JsonTime `json:"created_at" xorm:"created"`
UpdatedAt JsonTime `json:"updated_at" xorm:"updated"`
TaskID string `json:"task_id" xorm:"varchar(100) notnull unique 'task_id'"`
Service string `json:"service"`
Attempts uint16 `json:"attempts"`
Priority uint8 `json:"priority"`
Timestamp int64 `json:"timestamp"`
Status TaskStatus `json:"status" xorm:"int notnull index 'status'"`
Method string `json:"method"`
Body []byte `json:"body"`
Header map[string]string `json:"header"`
}
type TaskStatus ¶
type TaskStatus uint8
const ( TaskStatusCreated TaskStatus = iota TaskStatusPending TaskStatusSuccess TaskStatusFailed )
func (TaskStatus) String ¶
func (t TaskStatus) String() string
Click to show internal directories.
Click to hide internal directories.