md

package
v0.0.0-...-1285923 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFile

func AddFile(id string, fname string, savedir string, fsize int64, packet int64) error

AddFile ...

func AddPacket

func AddPacket(fid string, sort int, packetpath string) error

AddPacket ...

func CountRemoteSendLogByStatus

func CountRemoteSendLogByStatus(status int) int64

func DeleteUser

func DeleteUser(id string) error

DeleteUser ...

func DisableYserver

func DisableYserver(id string) error

DisableYserver ...

func Filecount

func Filecount() (int64, error)

Filecount ...

func FinshFile

func FinshFile(id string, status int) error

FinshFile ...

func Init

func Init(dir string, initUser string, initPwd string)

Init 初始化数据库

func InitYservefunc

func InitYservefunc()

InitYservefunc ...

func Localdb

func Localdb() *xorm.Engine

Localdb 返回数据库对象

func MailServerInit

func MailServerInit() error

MailServerInit ...

func NewLog

func NewLog(tid string, localfilepath string, status string) (string, error)

NewLog ...

func NowTime

func NowTime() int64

NowTime 返回当前时间戳

func RemoteStorageDeleteALL

func RemoteStorageDeleteALL(rid string) error

RemoteStorageDeleteALL 删除远程存储 单例

func RemoteStorageToTaskCheck

func RemoteStorageToTaskCheck(tid, rid string) (bool, error)

RemoteStorageToTaskCheck 远程存储和任务关联 查重

func RemoteStorageToTaskFunc

func RemoteStorageToTaskFunc(tid string, rids []string) error

RemoteStorageToTaskFunc 添加远程存储和任务关联

func TaskCount

func TaskCount(typestr string) (int64, error)

TaskCount ...

func TaskDeleteALL

func TaskDeleteALL(tid string) error

TaskDeleteALL ...

func UserChangePwd

func UserChangePwd(id, oldpassword, password string) error

UserChangePwd ...

func UserInit

func UserInit(username string, password string) error

UserInit ...

Types

type Host

type Host struct {
	ID       string `json:"id" xorm:"pk notnull unique 'id'"`
	Protocol string `json:"protocol" xorm:"'protocol'"`
	Name     string `json:"name" xorm:"'name'"`
	HostAddr string `json:"hostaddr" xorm:"'hostaddr'"`
	Port     string `json:"port" xorm:"'port'"`
	Username string `json:"username" xorm:"'username'"`
	Password string `json:"password" xorm:"'password'"`
	Created  int64  `json:"created" xorm:"'created'"`
}

func (*Host) Add

func (c *Host) Add() error

func (*Host) Delete

func (c *Host) Delete() error

func (*Host) Update

func (c *Host) Update() error

type Log

type Log struct {
	ID            string          `json:"id" xorm:"pk notnull unique 'id'"`
	Tid           string          `json:"tid" xorm:"notnull 'tid'"`
	Dbtype        string          `json:"dbtype" xorm:"_"`
	Status        int             `json:"status" xorm:"notnull 'status'"`
	Localfilepath string          `json:"localfilepath" xorm:"'localfilepath'"`
	Msg           string          `json:"msg" xorm:"msg"`
	Created       int64           `json:"created" xorm:"'created'"`
	Deleted       int64           `json:"deleted" xorm:"'deleted'"`
	DBInfo        Task            `json:"dbinfo" xorm:"-"`
	RS            []RemoteStorage `json:"rs" xorm:"-"`
	Errors        error           `json:"errors" xorm:"-"`
}

Log 日志结构体

func (*Log) Add

func (log *Log) Add() error

Add ...

func (*Log) Get

func (log *Log) Get() error

Add ...

type MailSend

type MailSend struct {
	ID         string   `json:"id" xorm:"pk notnull unique 'id'"`
	Created    int64    `json:"created" xorm:"'created'"`
	Subject    string   `json:"subject" xorm:"'subject'"`
	Body       string   `json:"body" xorm:"'body'"`
	ToUsers    []string `json:"tousers" xorm:"json 'tousers'"`
	FromUser   string   `json:"fromuser" xorm:"'fromuser'"`
	FromPasswd string   `json:"frompasswd" xorm:"-"`
	Host       string   `json:"host" xorm:"-"`
	Port       int      `json:"port" xorm:"-"`
	Status     int      `json:"status" xorm:"'status'"`
}

MailSend ...

func (*MailSend) Add

func (c *MailSend) Add() error

Add ...

func (*MailSend) Delete

func (c *MailSend) Delete() error

Delete ...

func (*MailSend) Update

func (c *MailSend) Update() error

Update ...

type MailServer

type MailServer struct {
	ID         string   `json:"id" xorm:"pk notnull unique 'id'"`
	Host       string   `json:"host" xorm:"'host'"`
	Port       int      `json:"port" xorm:"'port'"`
	Status     int      `json:"status" xorm:"'status'"`
	FromUser   string   `json:"fromuser" xorm:"'fromuser'"`
	FromPasswd string   `json:"frompassword" xorm:"'frompassword'"`
	Created    int64    `json:"created" xorm:"'created'"`
	MailTos    []string `json:"mailtos" xorm:"json 'mailtos'"`
}

MailServer ...

func (*MailServer) Update

func (c *MailServer) Update() error

Update ...

type RemoteStorage

type RemoteStorage struct {
	ID       string `json:"id" xorm:"pk notnull unique 'id'"`
	Name     string `json:"name" xorm:"'name'"`
	Types    string `json:"types" xorm:"'types'"`
	Username string `json:"username" xorm:" 'username' comment('用户名')"`
	Password string `json:"password" xorm:" 'password' comment('密码')"`
	Host     string `json:"host" xorm:" 'host' comment('ip地址')"`
	Path     string `json:"path" xorm:"'path' comment('路径')"`
	Port     int    `json:"port" xorm:"'port' comment('端口')"`
	Created  int64  `json:"created" xorm:"notnull 'created'"`
	ReLink   int    `json:"relink" xorm:"'relink'"`
}

RemoteStorage ...

func TaskFindRemote

func TaskFindRemote(tid string) ([]RemoteStorage, error)

TaskFindRemote 查询远程存储 单例

func (*RemoteStorage) Add

func (f *RemoteStorage) Add() error

Add 添加远程存储 单例

func (*RemoteStorage) Delete

func (f *RemoteStorage) Delete() error

Delete 删除远程存储 单例

func (*RemoteStorage) Update

func (f *RemoteStorage) Update() error

Update 查询远程存储 单例

type RemoteStorageToTask

type RemoteStorageToTask struct {
	ID      string `json:"id" xorm:"pk notnull unique 'id'"`
	Rid     string `json:"rid" xorm:"'rid' comment('远程存储ID')"`
	Tid     string `json:"tid" xorm:"'tid' comment('任务ID')"`
	Created int64  `json:"created" xorm:"notnull 'created'"`
}

RemoteStorageToTask ...

type Rlog

type Rlog struct {
	ID            string        `json:"id" xorm:"pk notnull unique 'id'"`
	Lid           string        `json:"lid" xorm:"'lid'"`
	Rid           string        `json:"rid" xorm:"'rid'"`
	Tid           string        `json:"tid" xorm:"'tid'"`
	Localfilepath string        `json:"localfilepath" xorm:"'localfilepath'"`
	Created       int64         `json:"created" xorm:"'created'"`
	Status        int           `json:"status" xorm:"'status'"`
	Msg           string        `json:"msg" xorm:"'msg'"`
	DBInfo        Task          `json:"dbinfo" xorm:"-"`
	RSInfo        RemoteStorage `json:"rsinfo" xorm:"-"`
	LogInfo       Log           `json:"loginfo" xorm:"-"`
	YsUploadFile  YsUploadFile  `json:"ysuploadfile" xorm:"-"`
}

Rlog ...

func AddNewRemoteSendLog

func AddNewRemoteSendLog(lid, tid, rid string) (*Rlog, error)

AddNewRemoteSendLog ...

func RemoteSendLogFindAll

func RemoteSendLogFindAll(tid string, page, limit int) ([]Rlog, error)

RlogAll ...

func (*Rlog) Update

func (r *Rlog) Update(err error)

Update ...

type SshTask

type SshTask struct {
	ID       string `json:"id" xorm:"pk notnull unique 'id'"`
	TaskType string `json:"tasktype" xorm:"'tasktype'"`
	Host     string `json:"host" xorm:"'host'"`
	SshUser  string `json:"sshuser" xorm:"'sshuser'"`
	SshPort  string `json:"sshport" xorm:"'sshport'"`
	SshPwd   string `json:"sshpwd" xorm:"'sshpwd'"`

	DbHost string `json:"dbhost" xorm:"'dbhost'"`
	DbPort string `json:"dbport" xorm:"'dbport'"`
	DbName string `json:"dbname" xorm:"'dbname'"`
	DbUser string `json:"dbuser" xorm:"'dbuser'"`
	DbPwd  string `json:"dbpwd" xorm:"'dbpwd'"`
	Char   string `json:"char" xorm:"'char'"`

	SavePath string   `json:"savepath" xorm:"'savepath'"`
	Zippwd   string   `json:"zippwd" xorm:"'zippwd'"`
	RS       []string `json:"rs" xorm:"-"`
	Crontab  string   `json:"crontab" xorm:"'crontab'"`
	Expire   int      `json:"expire" xorm:"'expire'"`
	Created  int64    `json:"created" xorm:"'created'"`
}

func (*SshTask) Add

func (c *SshTask) Add() error

func (*SshTask) Delete

func (c *SshTask) Delete() error

func (*SshTask) Update

func (c *SshTask) Update() error

type Task

type Task struct {
	ID       string   `json:"id" xorm:"pk notnull unique 'id'"`
	DBType   string   `json:"dbtype" xorm:" 'dbtype'"`
	Host     string   `json:"host" xorm:" 'host'"`
	Port     string   `json:"port" xorm:" 'port'"`
	User     string   `json:"user" xorm:" 'user'"`
	Password string   `json:"password" xorm:" 'password'"`
	DBname   string   `json:"dbname" xorm:" 'dbname'"`
	DBnames  []string `json:"dbnames" xorm:"-"`
	Char     string   `json:"char" xorm:" 'char'"`
	DBpath   string   `json:"dbpath" xorm:" 'dbpath'"`
	Created  int64    `json:"created" xorm:"notnull 'created'"`
	Pause    string   `json:"pause" xorm:" 'pause'"`
	Status   string   `json:"status" xorm:" 'status'"`
	Crontab  string   `json:"crontab" xorm:"notnull 'crontab'"`
	SavePath string   `json:"savepath" xorm:"notnull 'savepath'"`
	RS       []string `json:"rs" xorm:"-"`
	Zippwd   string   `json:"zippwd" xorm:"'zippwd'"`
	Expire   int      `json:"expire" xorm:"'expire'"`
}

Task ...

func All

func All() ([]Task, error)

All ...

func SelectAll

func SelectAll(typestr string, page, count int) ([]Task, error)

SelectAll ...

func (*Task) Add

func (t *Task) Add() error

Add ...

func (*Task) Delete

func (t *Task) Delete() error

Delete ...

func (*Task) Select

func (t *Task) Select() error

Select ...

func (*Task) Update

func (t *Task) Update() error

Update ...

type User

type User struct {
	ID       string   `json:"id" xorm:"pk notnull unique 'id'"`
	Name     string   `json:"name" xorm:"unique 'name'"`
	Passwrod string   `json:"password" xorm:"'password'"`
	IPlist   []string `json:"iplist" xorm:"json 'iplist'"`
	Created  int64    `json:"created" xorm:"'created'"`
}

User ...

func UserLogin

func UserLogin(name, password string) (*User, error)

UserLogin ...

func (*User) Add

func (u *User) Add() error

Add ...

func (*User) Update

func (u *User) Update() error

Update ...

type YsPacket

type YsPacket struct {
	ID              string `json:"id" xorm:"pk notnull unique 'id'"`
	Yid             string `json:"yid" xorm:"'yid'"`
	SortID          int    `json:"sortid" xorm:"'sortid'"`
	SrcPacketPath   string `json:"srcpacketpath" xorm:"'srcpacketpath'"`
	Offset          int64  `json:"offset" xorm:"'offset'"`
	UploadPacketURL string `json:"uploadpacketurl" xorm:"'uploadpacketurl'"`
	Status          int    `json:"status" xorm:"'status'"`
	Msg             string `json:"msg" xorm:"'msg'"`
}

YsPackets ...

type YsUploadFile

type YsUploadFile struct {
	ID                 string     `json:"id" xorm:"pk notnull unique 'id'"`
	Lid                string     `json:"lid" xorm:"'lid'"`
	UploadFileServerID string     `json:"ufsid" xorm:"'ufsid'"`
	SrcFilePath        string     `json:"srcfilepath" xorm:"'srcfilepath'"`
	Created            int64      `json:"created" xorm:"'created'"`
	Size               int64      `json:"size" xorm:"'size'"`
	PacketNum          int64      `json:"packetnum" xorm:"'packetnum'"`
	Status             int        `json:"status" xorm:"'status'"`
	Msg                string     `json:"msg" xorm:"'msg'"`
	YsPackets          []YsPacket `json:"packets" xorm:"-"`
}

YsUploadFile ...

func (*YsUploadFile) AddYsFileLog

func (ysuploadfile *YsUploadFile) AddYsFileLog(err error) error

AddYsFileLog ...

func (*YsUploadFile) AddYsPacketLog

func (yuf *YsUploadFile) AddYsPacketLog(ysp YsPacket) error

AddYsPacketLog ...

func (*YsUploadFile) UpdateYspacketLog

func (yuf *YsUploadFile) UpdateYspacketLog(sortid int, err error) error

UpdateYspacketLog ...

type Yserver

type Yserver struct {
	ID       string `json:"id" xorm:"pk notnull unique 'id'"`
	SavePath string `json:"savepath" xorm:"'savepath'"`
	Enable   bool   `json:"enable" xorm:"'enable'"`
	Username string `json:"username" xorm:"'username'"`
	Password string `json:"password" xorm:"'password'"`
	Port     int    `json:"port" xorm:"-"`
}

Yserver ...

func (*Yserver) EnableYserver

func (c *Yserver) EnableYserver() error

EnableYserver ...

type YserverFile

type YserverFile struct {
	ID             string          `json:"id" xorm:"pk notnull unique 'id'"`
	FileName       string          `json:"filename" xorm:"'filename'"`
	FileSize       int64           `json:"filesize" xorm:"'filesize'"`
	Packet         int64           `json:"packet" xorm:"packet"`
	Created        int64           `json:"created" xorm:"'created'"`
	Status         int             `json:"status" xorm:"'status'"`
	YserverPackets []YserverPacket `json:"yps" xorm:"-"`
}

YserverFile ...

func AllFile

func AllFile(page, limit int) ([]YserverFile, error)

AllFile ...

func FindFile

func FindFile(id string) (YserverFile, error)

FindFile ...

type YserverPacket

type YserverPacket struct {
	ID         string `json:"id" xorm:"pk notnull unique 'id'"`
	Fid        string `json:"fid" xorm:"'fid'"`
	PacketPath string `json:"packetpath" xorm:"'packetpath'"`
	Sort       int    `json:"sort" xorm:"'sort'"`
	Created    int64  `json:"created" xorm:"'created'"`
}

YserverPacket ...

func AllPacket

func AllPacket(id string) ([]YserverPacket, error)

AllPacket ...

Jump to

Keyboard shortcuts

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