mirror of https://github.com/Xhofe/alist
docs: add go report card [skip ci]
parent
284274b37e
commit
2d2a4f5776
13
README.md
13
README.md
|
@ -1,8 +1,11 @@
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://alist.nn.ci"><img height="100px" alt="logo" src="https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg"/></a>
|
<a href="https://alist.nn.ci"><img height="100px" alt="logo" src="https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg"/></a>
|
||||||
<p><em>🗂️A file list program that supports multiple storage, powered by Gin and Solidjs.</em></p>
|
<p><em>🗂️A file list program that supports multiple storage, powered by Gin and Solidjs.</em></p>
|
||||||
<a href="https://github.com/Xhofe/alist/releases">
|
<a href="https://goreportcard.com/report/github.com/alist-org/alist/v3">
|
||||||
<img src="https://img.shields.io/github/release/Xhofe/alist" alt="latest version" />
|
<img src="https://goreportcard.com/badge/github.com/alist-org/alist/v3" alt="latest version" />
|
||||||
|
</a>
|
||||||
|
<a href="https://github.com/Xhofe/alist/blob/main/LICENSE">
|
||||||
|
<img src="https://img.shields.io/github/license/Xhofe/alist" alt="License" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/Xhofe/alist/discussions">
|
<a href="https://github.com/Xhofe/alist/discussions">
|
||||||
<img src="https://img.shields.io/github/discussions/Xhofe/alist?color=%23ED8936" alt="discussions" />
|
<img src="https://img.shields.io/github/discussions/Xhofe/alist?color=%23ED8936" alt="discussions" />
|
||||||
|
@ -11,10 +14,10 @@
|
||||||
<img src="https://img.shields.io/github/workflow/status/Xhofe/alist/build" alt="Build status" />
|
<img src="https://img.shields.io/github/workflow/status/Xhofe/alist/build" alt="Build status" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/Xhofe/alist/releases">
|
<a href="https://github.com/Xhofe/alist/releases">
|
||||||
<img src="https://img.shields.io/github/downloads/Xhofe/alist/total?color=%239F7AEA" alt="Downloads" />
|
<img src="https://img.shields.io/github/release/Xhofe/alist" alt="latest version" />
|
||||||
</a>
|
</a>
|
||||||
<a href="https://github.com/Xhofe/alist/blob/v2/LICENSE">
|
<a href="https://github.com/Xhofe/alist/releases">
|
||||||
<img src="https://img.shields.io/github/license/Xhofe/alist" alt="License" />
|
<img src="https://img.shields.io/github/downloads/Xhofe/alist/total?color=%239F7AEA" alt="Downloads" />
|
||||||
</a>
|
</a>
|
||||||
<a title="Crowdin" target="_blank" href="https://crwd.in/alist">
|
<a title="Crowdin" target="_blank" href="https://crwd.in/alist">
|
||||||
<img src="https://badges.crowdin.net/alist/localized.svg">
|
<img src="https://badges.crowdin.net/alist/localized.svg">
|
||||||
|
|
|
@ -269,8 +269,9 @@ func (c *client) TellStatus(gid string, keys ...string) (info StatusInfo, err er
|
||||||
// `aria2.getUris([secret, ]gid)`
|
// `aria2.getUris([secret, ]gid)`
|
||||||
// This method returns the URIs used in the download denoted by gid (string).
|
// This method returns the URIs used in the download denoted by gid (string).
|
||||||
// The response is an array of structs and it contains following keys. Values are string.
|
// The response is an array of structs and it contains following keys. Values are string.
|
||||||
// uri URI
|
//
|
||||||
// status 'used' if the URI is in use. 'waiting' if the URI is still waiting in the queue.
|
// uri URI
|
||||||
|
// status 'used' if the URI is in use. 'waiting' if the URI is still waiting in the queue.
|
||||||
func (c *client) GetURIs(gid string) (infos []URIInfo, err error) {
|
func (c *client) GetURIs(gid string) (infos []URIInfo, err error) {
|
||||||
params := make([]interface{}, 0, 2)
|
params := make([]interface{}, 0, 2)
|
||||||
if c.token != "" {
|
if c.token != "" {
|
||||||
|
@ -457,12 +458,14 @@ func (c *client) GetOption(gid string) (m Option, err error) {
|
||||||
// `aria2.changeOption([secret, ]gid, options)`
|
// `aria2.changeOption([secret, ]gid, options)`
|
||||||
// This method changes options of the download denoted by gid (string) dynamically. options is a struct.
|
// This method changes options of the download denoted by gid (string) dynamically. options is a struct.
|
||||||
// The following options are available for active downloads:
|
// The following options are available for active downloads:
|
||||||
// bt-max-peers
|
//
|
||||||
// bt-request-peer-speed-limit
|
// bt-max-peers
|
||||||
// bt-remove-unselected-file
|
// bt-request-peer-speed-limit
|
||||||
// force-save
|
// bt-remove-unselected-file
|
||||||
// max-download-limit
|
// force-save
|
||||||
// max-upload-limit
|
// max-download-limit
|
||||||
|
// max-upload-limit
|
||||||
|
//
|
||||||
// For waiting or paused downloads, in addition to the above options, options listed in Input File subsection are available, except for following options: dry-run, metalink-base-uri, parameterized-uri, pause, piece-length and rpc-save-upload-metadata option.
|
// For waiting or paused downloads, in addition to the above options, options listed in Input File subsection are available, except for following options: dry-run, metalink-base-uri, parameterized-uri, pause, piece-length and rpc-save-upload-metadata option.
|
||||||
// This method returns OK for success.
|
// This method returns OK for success.
|
||||||
func (c *client) ChangeOption(gid string, option Option) (ok string, err error) {
|
func (c *client) ChangeOption(gid string, option Option) (ok string, err error) {
|
||||||
|
@ -497,17 +500,19 @@ func (c *client) GetGlobalOption() (m Option, err error) {
|
||||||
// This method changes global options dynamically.
|
// This method changes global options dynamically.
|
||||||
// options is a struct.
|
// options is a struct.
|
||||||
// The following options are available:
|
// The following options are available:
|
||||||
// bt-max-open-files
|
//
|
||||||
// download-result
|
// bt-max-open-files
|
||||||
// log
|
// download-result
|
||||||
// log-level
|
// log
|
||||||
// max-concurrent-downloads
|
// log-level
|
||||||
// max-download-result
|
// max-concurrent-downloads
|
||||||
// max-overall-download-limit
|
// max-download-result
|
||||||
// max-overall-upload-limit
|
// max-overall-download-limit
|
||||||
// save-cookies
|
// max-overall-upload-limit
|
||||||
// save-session
|
// save-cookies
|
||||||
// server-stat-of
|
// save-session
|
||||||
|
// server-stat-of
|
||||||
|
//
|
||||||
// In addition, options listed in the Input File subsection are available, except for following options: checksum, index-out, out, pause and select-file.
|
// In addition, options listed in the Input File subsection are available, except for following options: checksum, index-out, out, pause and select-file.
|
||||||
// With the log option, you can dynamically start logging or change log file.
|
// With the log option, you can dynamically start logging or change log file.
|
||||||
// To stop logging, specify an empty string("") as the parameter value.
|
// To stop logging, specify an empty string("") as the parameter value.
|
||||||
|
@ -526,13 +531,14 @@ func (c *client) ChangeGlobalOption(options Option) (ok string, err error) {
|
||||||
// `aria2.getGlobalStat([secret])`
|
// `aria2.getGlobalStat([secret])`
|
||||||
// This method returns global statistics such as the overall download and upload speeds.
|
// This method returns global statistics such as the overall download and upload speeds.
|
||||||
// The response is a struct and contains the following keys. Values are strings.
|
// The response is a struct and contains the following keys. Values are strings.
|
||||||
// downloadSpeed Overall download speed (byte/sec).
|
//
|
||||||
// uploadSpeed Overall upload speed(byte/sec).
|
// downloadSpeed Overall download speed (byte/sec).
|
||||||
// numActive The number of active downloads.
|
// uploadSpeed Overall upload speed(byte/sec).
|
||||||
// numWaiting The number of waiting downloads.
|
// numActive The number of active downloads.
|
||||||
// numStopped The number of stopped downloads in the current session.
|
// numWaiting The number of waiting downloads.
|
||||||
// This value is capped by the --max-download-result option.
|
// numStopped The number of stopped downloads in the current session.
|
||||||
// numStoppedTotal The number of stopped downloads in the current session and not capped by the --max-download-result option.
|
// This value is capped by the --max-download-result option.
|
||||||
|
// numStoppedTotal The number of stopped downloads in the current session and not capped by the --max-download-result option.
|
||||||
func (c *client) GetGlobalStat() (info GlobalStatInfo, err error) {
|
func (c *client) GetGlobalStat() (info GlobalStatInfo, err error) {
|
||||||
params := []string{}
|
params := []string{}
|
||||||
if c.token != "" {
|
if c.token != "" {
|
||||||
|
@ -570,8 +576,9 @@ func (c *client) RemoveDownloadResult(gid string) (ok string, err error) {
|
||||||
// `aria2.getVersion([secret])`
|
// `aria2.getVersion([secret])`
|
||||||
// This method returns the version of aria2 and the list of enabled features.
|
// This method returns the version of aria2 and the list of enabled features.
|
||||||
// The response is a struct and contains following keys.
|
// The response is a struct and contains following keys.
|
||||||
// version Version number of aria2 as a string.
|
//
|
||||||
// enabledFeatures List of enabled features. Each feature is given as a string.
|
// version Version number of aria2 as a string.
|
||||||
|
// enabledFeatures List of enabled features. Each feature is given as a string.
|
||||||
func (c *client) GetVersion() (info VersionInfo, err error) {
|
func (c *client) GetVersion() (info VersionInfo, err error) {
|
||||||
params := []string{}
|
params := []string{}
|
||||||
if c.token != "" {
|
if c.token != "" {
|
||||||
|
@ -584,7 +591,8 @@ func (c *client) GetVersion() (info VersionInfo, err error) {
|
||||||
// `aria2.getSessionInfo([secret])`
|
// `aria2.getSessionInfo([secret])`
|
||||||
// This method returns session information.
|
// This method returns session information.
|
||||||
// The response is a struct and contains following key.
|
// The response is a struct and contains following key.
|
||||||
// sessionId Session ID, which is generated each time when aria2 is invoked.
|
//
|
||||||
|
// sessionId Session ID, which is generated each time when aria2 is invoked.
|
||||||
func (c *client) GetSessionInfo() (info SessionInfo, err error) {
|
func (c *client) GetSessionInfo() (info SessionInfo, err error) {
|
||||||
params := []string{}
|
params := []string{}
|
||||||
if c.token != "" {
|
if c.token != "" {
|
||||||
|
@ -650,7 +658,7 @@ func (c *client) Multicall(methods []Method) (r []interface{}, err error) {
|
||||||
// `system.listMethods()`
|
// `system.listMethods()`
|
||||||
// This method returns the all available RPC methods in an array of string.
|
// This method returns the all available RPC methods in an array of string.
|
||||||
// Unlike other methods, this method does not require secret token.
|
// Unlike other methods, this method does not require secret token.
|
||||||
// This is safe because this method jsut returns the available method names.
|
// This is safe because this method just returns the available method names.
|
||||||
func (c *client) ListMethods() (methods []string, err error) {
|
func (c *client) ListMethods() (methods []string, err error) {
|
||||||
err = c.Call(aria2ListMethods, []string{}, &methods)
|
err = c.Call(aria2ListMethods, []string{}, &methods)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue