protocol

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Terminate = errors.New("terminate")
)

Functions

This section is empty.

Types

type DownloadMsg

type DownloadMsg struct {
	Event string `json:"event"`
	Oid   string `json:"oid"`
	Size  int64  `json:"size"`
}

type InitMsg

type InitMsg struct {
	Event               string `json:"event"`
	Operation           string `json:"operation"`
	Concurrent          bool   `json:"concurrent"`
	ConcurrentTransfers int    `json:"concurrenttransfers"`
}

type Session

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

func NewSession

func NewSession(stdin io.Reader, stdout io.Writer) *Session

func (*Session) Init

func (s *Session) Init() (msg *InitMsg, err error)

func (*Session) Ready

func (s *Session) Ready() (err error)

func (*Session) ReportCompletedDownload

func (s *Session) ReportCompletedDownload(oid, path string) (err error)

func (*Session) ReportCompletedUpload

func (s *Session) ReportCompletedUpload(oid string) (err error)

func (*Session) ReportFailedDownload

func (s *Session) ReportFailedDownload(oid, msg string) (err error)

func (*Session) ReportFailedUpload

func (s *Session) ReportFailedUpload(oid, msg string) (err error)

func (*Session) ReportProgress

func (s *Session) ReportProgress(oid string, change, total int64) (err error)

func (*Session) StartDownload

func (s *Session) StartDownload() (msg *DownloadMsg, err error)

func (*Session) StartUpload

func (s *Session) StartUpload() (msg *UploadMsg, err error)

type UploadMsg

type UploadMsg struct {
	Event string `json:"event"`
	Oid   string `json:"oid"`
	Size  int64  `json:"size"`
	Path  string `json:"path"`
}

Jump to

Keyboard shortcuts

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