client

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const ADD_URI = "aria2.addUri"
View Source
const CHANGE_GLOBAL_OPTION = "aria2.changeGlobalOption"
View Source
const Remove = "aria2.remove"
View Source
const SHELL_TO_USE = "bash"
View Source
const STATUS = "aria2.tellStatus"

Variables

This section is empty.

Functions

func ExecOsCmd

func ExecOsCmd(cmdStr string, checkStdErr bool) (string, error)

func ExecOsCmd2Screen

func ExecOsCmd2Screen(cmdStr string, checkStdErr bool) (string, error)

func ExecOsCmdBase

func ExecOsCmdBase(cmdStr string, out2Screen bool, checkStdErr bool) (string, error)

func LevelDbDelete added in v0.0.9

func LevelDbDelete(dbFilepath, key, value string) error

func LevelDbGet added in v0.0.9

func LevelDbGet(dbFilepath, key string) ([]byte, error)

func LevelDbPut added in v0.0.9

func LevelDbPut(dbFilepath, key string, value interface{}) error

Types

type Aria2ChangeMaxConcurrentDownloads added in v0.2.131

type Aria2ChangeMaxConcurrentDownloads struct {
	Id      string      `json:"id"`
	JsonRpc string      `json:"jsonrpc"`
	Error   *Aria2Error `json:"error"`
	Result  interface{} `json:"result"`
}

type Aria2Client added in v0.2.11

type Aria2Client struct {
	Host string
	// contains filtered or unexported fields
}

func GetAria2Client added in v0.2.11

func GetAria2Client(aria2Host, aria2Secret string, aria2Port int) *Aria2Client

func (*Aria2Client) ChangeMaxConcurrentDownloads added in v0.2.131

func (aria2Client *Aria2Client) ChangeMaxConcurrentDownloads(maxConcurrentDownloads string) *Aria2ChangeMaxConcurrentDownloads

func (*Aria2Client) DownloadFile added in v0.2.11

func (aria2Client *Aria2Client) DownloadFile(uri string, outDir, outFilename string) *Aria2Download

func (*Aria2Client) GenPayload4Download added in v0.2.11

func (aria2Client *Aria2Client) GenPayload4Download(method string, uri string, outDir, outFilename string) Aria2Payload

func (*Aria2Client) GenPayload4Status added in v0.2.11

func (aria2Client *Aria2Client) GenPayload4Status(gid string) Aria2Payload

func (*Aria2Client) GetDownloadStatus added in v0.2.11

func (aria2Client *Aria2Client) GetDownloadStatus(gid string) *Aria2Status

func (*Aria2Client) RemoveDownload added in v0.3.0

func (aria2Client *Aria2Client) RemoveDownload(gid string) (err error)

type Aria2Download added in v0.2.11

type Aria2Download struct {
	Id      string      `json:"id"`
	JsonRpc string      `json:"jsonrpc"`
	Error   *Aria2Error `json:"error"`
	Gid     string      `json:"result"`
}

type Aria2DownloadOption added in v0.2.11

type Aria2DownloadOption struct {
	Out string `json:"out"`
	Dir string `json:"dir"`

	UserAgent string `json:"user-agent,omitempty"`
}

type Aria2Error added in v0.2.11

type Aria2Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type Aria2Payload added in v0.2.11

type Aria2Payload struct {
	JsonRpc string        `json:"jsonrpc"`
	Id      string        `json:"id"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
}

type Aria2Resp added in v0.3.0

type Aria2Resp struct {
	Id      string      `json:"id"`
	JsonRpc string      `json:"jsonrpc"`
	Error   *Aria2Error `json:"error"`
	Result  interface{} `json:"result"`
}

type Aria2Status added in v0.2.11

type Aria2Status struct {
	Id      string             `json:"id"`
	JsonRpc string             `json:"jsonrpc"`
	Error   *Aria2Error        `json:"error"`
	Result  *Aria2StatusResult `json:"result"`
}

type Aria2StatusResult added in v0.2.11

type Aria2StatusResult struct {
	Bitfield        string                  `json:"bitfield"`
	CompletedLength string                  `json:"completedLength"`
	Connections     string                  `json:"connections"`
	Dir             string                  `json:"dir"`
	DownloadSpeed   string                  `json:"downloadSpeed"`
	ErrorCode       string                  `json:"errorCode"`
	ErrorMessage    string                  `json:"errorMessage"`
	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"`
	Files           []Aria2StatusResultFile `json:"files"`
}

type Aria2StatusResultFile added in v0.2.11

type Aria2StatusResultFile struct {
	CompletedLength string                     `json:"completedLength"`
	Index           string                     `json:"index"`
	Length          string                     `json:"length"`
	Path            string                     `json:"path"`
	Selected        string                     `json:"selected"`
	Uris            []Aria2StatusResultFileUri `json:"uris"`
}

type Aria2StatusResultFileUri added in v0.2.11

type Aria2StatusResultFileUri struct {
	Status string `json:"status"`
	Uri    string `json:"uri"`
}

type ChangeMaxConcurrentDownloads added in v0.2.131

type ChangeMaxConcurrentDownloads struct {
	MaxConcurrentDownloads string `json:"max-concurrent-downloads"`
}

type JsonRpcParams added in v0.2.11

type JsonRpcParams struct {
	JsonRpc string        `json:"jsonrpc"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
	Id      int           `json:"id"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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