Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DCC ¶
type DCC struct {
// contains filtered or unexported fields
}
DCC creates a new socket client instance where it'll download the DCC transaction into the specified io.Writer destination
func NewDCC ¶
func NewDCC( address string, size int, writer io.Writer, dialFunc func(ctx context.Context, network, address string) (net.Conn, error), ) *DCC
NewDCC creates a new DCC instance. the host, port are needed for the socket client connection the size is required so the download progress is calculated the writer is required to store the transaction fragments into the specified io.Writer
func (*DCC) Run ¶
Run established the connection with the DCC TCP socket and returns two channels, where one is used for the download progress and the other is used to return exceptions during our transaction. A context is required, where you have the ability to cancel and timeout a download. One should check the second value for the progress/error channels when receiving data as if the channels are closed, it means that the transaction is finished or got interrupted.