service

package
v0.0.0-...-d509172 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDownloadPath

func GetDownloadPath() string

func PipeGetList

func PipeGetList(pipeNames ...string) []func(*httpclient.Downloader) error

func PipeList

func PipeList() map[string]*Pipe

func PipeRegister

func PipeRegister(pipe *Pipe)

func PipeUnregister

func PipeUnregister(ident string)

Types

type DJob

type DJob struct {
	Id         int
	FileName   string
	Size       int64
	Downloaded int64
	Progress   int64
	Speed      int64
	State      string
}

type DServ

type DServ struct {
	// contains filtered or unexported fields
}

func (*DServ) LoadSettings

func (srv *DServ) LoadSettings(sf string) error

func (*DServ) Progress

func (srv *DServ) Progress() []DJob

func (*DServ) ProgressSockJS

func (srv *DServ) ProgressSockJS(c sockjs.Session) error

func (*DServ) Register

func (srv *DServ) Register(r echo.RouteRegister, enableSockJS bool)

func (*DServ) SavePath

func (srv *DServ) SavePath() func() string

func (*DServ) SaveSettings

func (srv *DServ) SaveSettings(sf string) error

func (*DServ) SetSavePath

func (srv *DServ) SetSavePath(savePath func() string) *DServ

func (*DServ) SetTmpl

func (srv *DServ) SetTmpl(tmpl string) *DServ

func (*DServ) StartAllTask

func (srv *DServ) StartAllTask()

func (*DServ) StopAllTask

func (srv *DServ) StopAllTask()

func (*DServ) Tmpl

func (srv *DServ) Tmpl() string

type DownloadSettings

type DownloadSettings struct {
	FI httpclient.FileInfo           `json:"FileInfo"`
	Dp []httpclient.DownloadProgress `json:"DownloadProgress"`
}

type NewJob

type NewJob struct {
	Url       string
	PartCount int64
	FilePath  string
	Pipes     []string
}

type Pipe

type Pipe struct {
	Ident      string
	Label      string
	Extensions []string
	// contains filtered or unexported fields
}

func NewPipe

func NewPipe(ident string, label string, f func(*httpclient.Downloader) error, extensions ...string) *Pipe

func PipeGet

func PipeGet(ident string) *Pipe

func (*Pipe) Function

func (p *Pipe) Function() func(*httpclient.Downloader) error

func (*Pipe) SetFunction

func (p *Pipe) SetFunction(f func(*httpclient.Downloader) error) *Pipe

type ServiceSettings

type ServiceSettings struct {
	Ds []DownloadSettings
}

func LoadFromFile

func LoadFromFile(s string) (*ServiceSettings, error)

func (*ServiceSettings) SaveToFile

func (s *ServiceSettings) SaveToFile(fp string) error

Jump to

Keyboard shortcuts

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