service

package
v0.0.0-...-5801c3e Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChunkSize = 1024 * 1024 * 10
	AckSlots  = 3
	HeadSize  = int(unsafe.Sizeof(DownlodMsg{}) + unsafe.Sizeof(wire.Header{}))
)
View Source
const (
	Start byte = iota
	Ack
	Resend
	Pause
	Resume
	Stop
	// agent side control states
	File
	Folder
	Hash
	Finished

	// service states
	ReadyToGo
	Running
	Paused
	Done
	QueueFree
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Down

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

Down is Downloader service

func (*Down) Close

func (d *Down) Close()

func (*Down) Consume

func (d *Down) Consume(b []byte)

func (*Down) Run

func (d *Down) Run()

type DownlodMsg

type DownlodMsg struct {
	Control byte
	ID      byte
	Offset  int64
}

type Manager

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

func NewManager

func NewManager(out chan []byte) *Manager

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) Consume

func (m *Manager) Consume(h *wire.Header, data []byte)

type Servicer

type Servicer interface {
	Run()
	Consume([]byte)
	Close()
}

type Up

type Up struct {
}

Uploader service

func (*Up) Close

func (d *Up) Close()

func (*Up) Consume

func (d *Up) Consume([]byte)

func (*Up) Run

func (d *Up) Run()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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