util

package
v0.0.0-...-df21f05 Latest Latest
Warning

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

Go to latest
Published: May 18, 2019 License: GPL-3.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error)

func GetBody

func GetBody(url string, callback ChannelCallback)

根据url获取xml转为RSS对象

func QbAddFromUrl

func QbAddFromUrl(baseUrl string, cookie string, data QBAddUrlData)

urls url地址 autoTMM: 管理模式 savepath: 保存路径 cookie: rename: 重命名 category: 分类 paused: 是否暂停 skip_checking: 是否跳过检查 root_folder: 是否创建子文件夹 dlLimit: 限制下载速度 B/s upLimit: 限制上传速度 b/S

func QbGetCookie

func QbGetCookie(qb Client) (string, error)

200 Fails. Ok.

func TrAdd

func TrAdd(tr Client, data TransmissionAdd, callback TransmissionAddCallback)

func TrConnect

func TrConnect(tr Client, callback TransmissionCallback)

func TrExec

func TrExec(tr Client, data TransmissionData, callback TransmissionCallback)

Types

type ChannelCallback

type ChannelCallback func(channel RSSChannel)

type Client

type Client struct {
	Local, User, Pwd string
}

type QBAddUrlData

type QBAddUrlData struct {
	Urls                               string
	AutoTMM                            bool
	SavePath, Cookie, Rename, Category string
	Paused, Skip_checking, Root_folder bool
}

type RSS

type RSS struct {
	xml.Name `xml:"rss"`
	Channel  RSSChannel `xml:"channel"`
}

type RSSChannel

type RSSChannel struct {
	Title       string    `xml:"title"`
	Link        string    `xml:"link"`
	Description string    `xml:"description"`
	Language    string    `xml:"language"`
	PubDate     string    `xml:"pubDate"`
	Generator   string    `xml:"generator"`
	Docs        string    `xml:"docs"`
	TTL         int       `xml:"ttl"`
	Items       []RSSItem `xml:"item"`
}

type RSSEnclosure

type RSSEnclosure struct {
	Url    string `xml:"url,attr"`
	Length int    `xml:"length,attr"`
	Type   string `xml:"type,attr"`
}

type RSSItem

type RSSItem struct {
	Title           string       `xml:"title"`
	Link            string       `xml:"link"`
	Description     string       `xml:"description"`
	Enclosure       RSSEnclosure `xml:"enclosure"`
	GuidValue       string       `xml:"guid"`
	GuidIsPermaLink bool         `xml:"isPermaLink,attr"`
	PubDate         string       `xml:"pubDate"`
}

type TransmissionAdd

type TransmissionAdd struct {
	MetaInfo    string `json:"metainfo,omitempty"`
	Filename    string `json:"filename"`
	DownloadDir string `json:"download-dir,omitempty"`
	Paused      bool   `json:"paused"`
}

处理tr add结构体

type TransmissionAddCallback

type TransmissionAddCallback func(body []byte, res *http.Response, result TransmissionAddResult, err error)

type TransmissionAddResult

type TransmissionAddResult struct {
	Result TransmissionResult
	Flag   string
}

type TransmissionCallback

type TransmissionCallback func(body []byte, res *http.Response, result TransmissionResult, err error)

type TransmissionData

type TransmissionData struct {
	Method    string      `json:"method"`
	Arguments interface{} `json:"arguments"`
	Tag       string      `json:"tag"`
}

type TransmissionResult

type TransmissionResult struct {
	Arguments interface{} `json:"arguments"`
	Result    string      `json:"result"`
}

Jump to

Keyboard shortcuts

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