nets

package
v0.0.0-...-7647e70 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDownloader

func NewDownloader() *downloader

Types

type Client

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

func (*Client) Close

func (this *Client) Close()

func (*Client) Connect

func (this *Client) Connect(network string, address string) error

func (*Client) Id

func (this *Client) Id() int

func (*Client) LocalAddr

func (this *Client) LocalAddr() net.Addr

func (*Client) Receive

func (this *Client) Receive(receiver func(data []byte))

func (*Client) RemoteAddr

func (this *Client) RemoteAddr() net.Addr

func (*Client) Write

func (this *Client) Write(bytes []byte)

func (*Client) WriteString

func (this *Client) WriteString(message string)

func (*Client) Writeln

func (this *Client) Writeln(message string)

type DownloaderItem

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

func (*DownloaderItem) ContentLength

func (this *DownloaderItem) ContentLength() uint64

func (*DownloaderItem) Error

func (this *DownloaderItem) Error() error

func (*DownloaderItem) File

func (this *DownloaderItem) File() *os.File

func (*DownloaderItem) IsCompleted

func (this *DownloaderItem) IsCompleted() bool

func (*DownloaderItem) IsDownloading

func (this *DownloaderItem) IsDownloading() bool

func (*DownloaderItem) Progress

func (this *DownloaderItem) Progress() float32

func (*DownloaderItem) Size

func (this *DownloaderItem) Size() uint64

func (*DownloaderItem) Start

func (this *DownloaderItem) Start()

func (*DownloaderItem) Success

func (this *DownloaderItem) Success() bool

func (*DownloaderItem) Tag

func (this *DownloaderItem) Tag() string

func (*DownloaderItem) Target

func (this *DownloaderItem) Target() string

func (*DownloaderItem) URL

func (this *DownloaderItem) URL() string

type Server

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

func NewServer

func NewServer(network, address string) *Server

func (*Server) AcceptClient

func (this *Server) AcceptClient(callback func(client *Client))

func (*Server) Close

func (this *Server) Close() error

func (*Server) CloseClient

func (this *Server) CloseClient(callback func(client *Client))

func (*Server) Listen

func (this *Server) Listen() error

func (*Server) ReceiveClient

func (this *Server) ReceiveClient(callback func(client *Client, data []byte))

Jump to

Keyboard shortcuts

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