basic

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notify

type Notify interface {
	// Done returns a channel that's closed when work done.
	Done() <-chan struct{}

	// Result returns the NotifyResult and only valid after Done channel is closed.
	Result() NotifyResult
}

Notify defines how to notify asynchronous call if finished and get the result.

type NotifyResult

type NotifyResult interface {
	Success() bool
	Error() error
	Data() interface{}
}

NotifyResult defines the result of notify.

type RangeRequest

type RangeRequest interface {
	URL() string
	Offset() int64
	Size() int64
	Header() map[string]string

	// Extra gets the extra info.
	Extra() interface{}
}

RangeRequest defines the range request.

type Response

type Response interface {
	Success() bool
	Data() interface{}
}

Response defines the response.

type SchedulePeerInfo

type SchedulePeerInfo struct {
	// basic peer info
	*types.PeerInfo
	// Path represents the path to get resource from the peer.
	Path string
}

SchedulePeerInfo defines how to get resource from peer info.

type SchedulePieceDataResult

type SchedulePieceDataResult struct {
	Off  int64
	Size int64

	// PeerInfos represents the schedule peers which to get the range data.
	PeerInfos []*SchedulePeerInfo
}

SchedulerResult defines the result of schedule of range data.

Jump to

Keyboard shortcuts

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