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 ¶
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.
Click to show internal directories.
Click to hide internal directories.