Documentation
¶
Index ¶
- type Client
- func (c *Client) AddURI(uris []string, options ...any) (string, error)
- func (c *Client) GetGlobalStat() (stat GlobalStat, err error)
- func (c *Client) ListMethods() (methods []string, err error)
- func (c *Client) TellStatus(gid string, keys ...string) (statusInfo StatusInfo, err error)
- func (c *Client) TellStopped(offset, num int, keys ...string) (list []StatusInfo, err error)
- type Event
- type GlobalStat
- type Notifier
- type Option
- type StatusInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddURI ¶
AddURI https://aria2.github.io/manual/en/html/aria2c.html#aria2.addUri
func (*Client) GetGlobalStat ¶
func (c *Client) GetGlobalStat() (stat GlobalStat, err error)
func (*Client) ListMethods ¶
func (*Client) TellStatus ¶
func (c *Client) TellStatus(gid string, keys ...string) (statusInfo StatusInfo, err error)
TellStatus | active waiting paused error complete removed https://aria2.github.io/manual/en/html/aria2c.html#aria2.tellStatus
func (*Client) TellStopped ¶
func (c *Client) TellStopped(offset, num int, keys ...string) (list []StatusInfo, err error)
type GlobalStat ¶
type Notifier ¶
type Notifier interface {
OnDownloadStart([]Event)
OnDownloadPause([]Event)
OnDownloadStop([]Event)
OnDownloadComplete([]Event)
OnDownloadError([]Event)
OnBtDownloadComplete([]Event)
}
Notifier handles rpc notification from aria2 server
type StatusInfo ¶
type StatusInfo struct {
CompletedLength string `json:"completedLength"`
Connections string `json:"connections"`
Dir string `json:"dir"`
DownloadSpeed string `json:"downloadSpeed"`
ErrorCode string `json:"errorCode"`
ErrorMessage string `json:"errorMessage"`
Files []struct {
CompletedLength string `json:"completedLength"`
Index string `json:"index"`
Length string `json:"length"`
Path string `json:"path"`
Selected string `json:"selected"`
Uris []struct {
Status string `json:"status"`
Uri string `json:"uri"`
} `json:"uris"`
} `json:"files"`
Gid string `json:"gid"`
NumPieces string `json:"numPieces"`
PieceLength string `json:"pieceLength"`
Status string `json:"status"`
TotalLength string `json:"totalLength"`
UploadLength string `json:"uploadLength"`
UploadSpeed string `json:"uploadSpeed"`
}
Click to show internal directories.
Click to hide internal directories.