models

package
v0.0.0-...-c899e52 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2015 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDBC

func InitDBC(dbUser, dbPass, dbName, dbAddr string) error

Types

type File

type File struct {
	Id       int64    `json:"id"`
	Torrent  *Torrent `orm:"rel(fk);on_delete(do_nothing)"`
	Name     string   `orm:"type(text)"`
	Length   uint64
	Md5      string    `orm:"size(256);null"`
	CreateAt time.Time `orm:"auto_now_add;type(datetime)" json:"-"`
}

type Torrent

type Torrent struct {
	Id       int64  `json:"id"`
	InfoHash string `orm:"unique"  json:"infoHash"`
	Name     string `orm:"type(text)" json:"name"`
	//	FileType       string    `orm:"size(30)"`
	LastDownloadAt time.Time `orm:"null;type(datetime)"  json:"lastDownDate"`
	LastDownloadIp string    `orm:"null;size(50)"`
	Hot            uint64    `json:"hot"`        // 下载热度
	FileLen        uint64    `json:"fileLength"` // 文件大小
	FileCount      int       `json:"fileCount"`  // 文件数量
	Magnet         string    `json:"magnet"`     // 磁力链接
	Md5            string    `orm:"size(156);null"`
	Enable         bool      `json:"enable"`       // 审核标志
	FileList       []*File   `orm:"reverse(many)"` // multiple files.
	CreateDate     time.Time `orm:"type(datetime)"  json:"createDate"`
	CreateAt       time.Time `orm:"auto_now_add;type(datetime)" json:"-"`
}

func (*Torrent) Create

func (t *Torrent) Create() error

new torrent

func (*Torrent) IsExists

func (t *Torrent) IsExists() bool

isHave

Jump to

Keyboard shortcuts

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