Documentation ¶
Overview ¶
Provides a state management interface for all current downloads and the settings object
Index ¶
- Constants
- func NewRpcClient() (client *rpc.Client, err error)
- func StartRpcServer(m *Manager) (err error)
- type AllChunksDownloadingError
- type BasicAuthCredentials
- type ByteSize
- type Chunk
- func (c *Chunk) Close() (err error)
- func (c *Chunk) DestinationFile() string
- func (c *Chunk) DestinationFolder() string
- func (c *Chunk) Dl() (err error)
- func (c *Chunk) Download()
- func (c *Chunk) IsChunkCompleteError(err error) (ok bool)
- func (c *Chunk) Read(p []byte) (n int, err error)
- func (c *Chunk) Setup() (err error)
- func (c *Chunk) Write(p []byte) (n int, err error)
- type ChunkCompleteError
- type ChunkStore
- type Credentials
- type Display
- type Downloadable
- type Downloader
- type Manager
- type Publisher
- type Resource
- type RpcController
- type Settings
- type SettingsStore
- type SpeedMonitor
Constants ¶
View Source
const (
RPC_PORT = 7696
)
Variables ¶
This section is empty.
Functions ¶
func NewRpcClient ¶
func StartRpcServer ¶
Types ¶
type AllChunksDownloadingError ¶
type AllChunksDownloadingError struct {
// contains filtered or unexported fields
}
Move to main package
func (AllChunksDownloadingError) Error ¶
func (e AllChunksDownloadingError) Error() string
type BasicAuthCredentials ¶
type BasicAuthCredentials struct {
// contains filtered or unexported fields
}
func (*BasicAuthCredentials) Authenticate ¶
type Chunk ¶
type Chunk struct { io.ReadCloser Downloadable Percent int // contains filtered or unexported fields }
func (*Chunk) DestinationFile ¶
func (*Chunk) DestinationFolder ¶
func (*Chunk) IsChunkCompleteError ¶
type ChunkCompleteError ¶
type ChunkCompleteError struct {
// contains filtered or unexported fields
}
func (ChunkCompleteError) Error ¶
func (e ChunkCompleteError) Error() string
type ChunkStore ¶
type ChunkStore struct { io.ReadWriteCloser // contains filtered or unexported fields }
func NewChunkStore ¶
func NewChunkStore(location string) *ChunkStore
func (*ChunkStore) Open ¶
func (cs *ChunkStore) Open() (err error)
func (*ChunkStore) Remove ¶
func (cs *ChunkStore) Remove() (err error)
func (*ChunkStore) Size ¶
func (cs *ChunkStore) Size() (b ByteSize, err error)
type Credentials ¶
type Downloadable ¶
type Downloadable struct { Downloaded ByteSize Size ByteSize Resource *Resource // contains filtered or unexported fields }
func (*Downloadable) Progress ¶
func (d *Downloadable) Progress() int
type Downloader ¶
type Downloader struct { Downloadable io.WriteCloser Chunks []*Chunk CompleteChunks int MaxChunks int SpeedMonitor *SpeedMonitor TotalChunks int // contains filtered or unexported fields }
func NewDownloader ¶
func NewDownloader(url string, updater chan *Downloader) (d Downloader, err error)
func (*Downloader) AreAllChunksDownloading ¶
func (d *Downloader) AreAllChunksDownloading(err error) (ok bool)
func (*Downloader) Close ¶
func (d *Downloader) Close()
func (*Downloader) DestinationFile ¶
func (d *Downloader) DestinationFile() string
func (*Downloader) Start ¶
func (d *Downloader) Start(resume bool)
type Manager ¶
type Manager struct { Downloads map[url.URL]*Downloader Publisher *Publisher // contains filtered or unexported fields }
func NewManager ¶
func (*Manager) RestoreState ¶
type Publisher ¶
type Publisher struct {
Subscribers []string
}
func NewPublisher ¶
func NewPublisher() *Publisher
type Resource ¶
type Resource struct { Name string Hoster hosters.Hoster Url *url.URL // contains filtered or unexported fields }
func NewResource ¶
type RpcController ¶
type RpcController struct {
// contains filtered or unexported fields
}
func (*RpcController) AddDownload ¶
func (c *RpcController) AddDownload(url string, ok *bool) (err error)
type Settings ¶
type SettingsStore ¶
type SettingsStore struct {
io.ReadWriter
}
type SpeedMonitor ¶
type SpeedMonitor struct { Speed ByteSize // Bytes / Second // contains filtered or unexported fields }
func NewSpeedMonitor ¶
func NewSpeedMonitor(updater chan ByteSize) *SpeedMonitor
func (*SpeedMonitor) Start ¶
func (s *SpeedMonitor) Start()
func (*SpeedMonitor) Stop ¶
func (s *SpeedMonitor) Stop()
Click to show internal directories.
Click to hide internal directories.