client

package
v0.2.105 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2021 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const ADD_URI = "aria2.addUri"
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 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) 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

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"`
}

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 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 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