Documentation ¶
Index ¶
Constants ¶
View Source
const ( HttpCodeOK = 200 HttpCodePartialContent = 206 HttpHeaderRange = "Range" HttpHeaderAcceptRanges = "Accept-Ranges" HttpHeaderContentLength = "Content-Length" HttpHeaderContentRange = "Content-Range" HttpHeaderContentDisposition = "Content-Disposition" HttpHeaderUserAgent = "User-Agent" HttpHeaderLastModified = "Last-Modified" HttpHeaderBytes = "bytes" HttpHeaderRangeFormat = "bytes=%d-%d" )
Variables ¶
View Source
var ( NotFound = errors.New("not found") BadParams = errors.New("bad params") )
View Source
var Version string
Version is the build version, set at build time, using `go build -ldflags "-X github.com/GopeedLab/gopeed/pkg/base.Version=1.0.0"`.
Functions ¶
func ParseOptsExtra ¶
func ParseReqExtra ¶
Types ¶
type Options ¶
type Options struct { // Download file name Name string `json:"name"` // Download file path Path string `json:"path"` // Select file indexes to download SelectFiles []int `json:"selectFiles"` // Extra info for specific fetcher Extra any `json:"extra"` }
Options for download
func (*Options) InitSelectFiles ¶ added in v1.4.0
type Request ¶
type Request struct { URL string `json:"url"` Extra any `json:"extra"` // Labels is used to mark the download task Labels map[string]string `json:"labels"` }
Request download request
type Resource ¶
type Resource struct { // if name is not empty, the resource is a folder and the name is the folder name Name string `json:"name"` Size int64 `json:"size"` // is support range download Range bool `json:"range"` // file list Files []*FileInfo `json:"files"` Hash string `json:"hash"` }
Resource download resource
Click to show internal directories.
Click to hide internal directories.