network

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOutboundIP

func GetOutboundIP() (ip net.IP, err error)

func ServeFileData

func ServeFileData(file string, w http.ResponseWriter, req *http.Request) (err error)

Types

type Download

type Download struct {
	Done chan struct{}

	Err error
	// contains filtered or unexported fields
}

func NewDownload

func NewDownload(url url.URL) (download *Download, err error)

func (*Download) BytesPerSecond

func (download *Download) BytesPerSecond() (speed float64)

func (*Download) Download

func (download *Download) Download(ctx context.Context, writer io.Writer)

func (*Download) Duration

func (download *Download) Duration() (duration time.Duration)

func (*Download) EndTime

func (download *Download) EndTime() (time time.Time)

func (*Download) Filename

func (download *Download) Filename() (filename string)

func (*Download) Filesize

func (download *Download) Filesize() (size uint64)

func (*Download) IsComplete

func (download *Download) IsComplete() bool

func (*Download) Progress

func (download *Download) Progress() (progress float64)

func (*Download) StartDownload

func (download *Download) StartDownload(ctx context.Context, writer io.Writer)

func (*Download) StartTime

func (download *Download) StartTime() (time time.Time)

func (*Download) Subscribe

func (download *Download) Subscribe(subscriber chan struct{})

func (*Download) Unsubscribe

func (download *Download) Unsubscribe(subscriber chan struct{})

Jump to

Keyboard shortcuts

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