Documentation ¶
Index ¶
- Variables
- func Untar(ctx context.Context, storage afero.Fs, r io.Reader, dirMask fs.FileMode) error
- type ArchiverAlgo
- type ChecksumEncoding
- type CompressionAlgo
- type DownloadTask
- type DownloadTaskState
- type DownloaderWorker
- type Requester
- type RequesterFunc
- type SafeWriteConfig
- type State
- type StaticDownloadTaskState
- type StaticTaskState
- type Task
- type TaskState
- type Validity
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCheckSumUnmatched = errors.New("check sum unmatched")
Functions ¶
Types ¶
type ChecksumEncoding ¶
type ChecksumEncoding string
const ( Base64 ChecksumEncoding = "base64" Hex ChecksumEncoding = "hex" )
func (ChecksumEncoding) Encode ¶
func (e ChecksumEncoding) Encode(data []byte) string
type CompressionAlgo ¶
type CompressionAlgo string
const ( Bzip2 CompressionAlgo = "bzip2" Flate CompressionAlgo = "flate" Gzip CompressionAlgo = "gzip" // Lzw CompressionAlgo = "lzw" Zlib CompressionAlgo = "zlib" )
func (CompressionAlgo) Decompress ¶
func (a CompressionAlgo) Decompress(r io.Reader) (io.ReadCloser, error)
type DownloadTask ¶
type DownloadTaskState ¶
type DownloadTaskState struct { State State Downloaded *atomic.Int64 DownloadTask DownloadTask Err error // contains filtered or unexported fields }
func NewDownloadTaskState ¶
func NewDownloadTaskState(t DownloadTask) *DownloadTaskState
func (*DownloadTaskState) Snapshot ¶
func (s *DownloadTaskState) Snapshot() StaticDownloadTaskState
type DownloaderWorker ¶
type DownloaderWorker struct {
// contains filtered or unexported fields
}
func NewDownloaderWorker ¶
func NewDownloaderWorker( storage afero.Fs, safeWriteConfig SafeWriteConfig, limit uint, requester Requester, ) *DownloaderWorker
func (*DownloaderWorker) Run ¶
func (w *DownloaderWorker) Run(ctx context.Context)
func (*DownloaderWorker) Send ¶
func (w *DownloaderWorker) Send(t *DownloadTaskState)
type RequesterFunc ¶
func (RequesterFunc) Request ¶
func (f RequesterFunc) Request(ctx context.Context, target *url.URL) (io.ReadCloser, error)
type SafeWriteConfig ¶
type SafeWriteConfig struct { TempDir string DirMask fs.FileMode ForceDirMask bool ForceFileMask bool }
func (SafeWriteConfig) RemoveTemp ¶
func (c SafeWriteConfig) RemoveTemp(storage afero.Fs) error
type StaticDownloadTaskState ¶
type StaticDownloadTaskState struct { State State Downloaded int64 DownloadTask DownloadTask Err error }
type StaticTaskState ¶
type StaticTaskState struct { State State Downloaded int64 Task Task DownloadTaskState []StaticDownloadTaskState Err error }
type Task ¶
type Task struct { // Download destination path. Dest should be slash delimited. Dest string ArchiveAlgo ArchiverAlgo CompressionAlgo CompressionAlgo Validity Validity Tasks []DownloadTask }
type TaskState ¶
type TaskState struct { State State Downloaded *atomic.Int64 Task Task DownloadTaskState []*DownloadTaskState Err error // contains filtered or unexported fields }
func NewTaskState ¶
func (*TaskState) Snapshot ¶
func (t *TaskState) Snapshot() StaticTaskState
Click to show internal directories.
Click to hide internal directories.