Documentation ¶
Index ¶
- type V1
- func (v *V1) AnnounceHost(ctx context.Context, req *schedulerv1.AnnounceHostRequest) error
- func (v *V1) AnnounceTask(ctx context.Context, req *schedulerv1.AnnounceTaskRequest) error
- func (v *V1) LeaveHost(ctx context.Context, req *schedulerv1.LeaveHostRequest) error
- func (v *V1) LeaveTask(ctx context.Context, req *schedulerv1.PeerTarget) error
- func (v *V1) RegisterPeerTask(ctx context.Context, req *schedulerv1.PeerTaskRequest) (*schedulerv1.RegisterResult, error)
- func (v *V1) ReportPeerResult(ctx context.Context, req *schedulerv1.PeerResult) error
- func (v *V1) ReportPieceResult(stream schedulerv1.Scheduler_ReportPieceResultServer) error
- func (v *V1) StatTask(ctx context.Context, req *schedulerv1.StatTaskRequest) (*schedulerv1.Task, error)
- type V2
- func (v *V2) AnnounceHost(ctx context.Context, req *schedulerv2.AnnounceHostRequest) error
- func (v *V2) AnnouncePeer(stream schedulerv2.Scheduler_AnnouncePeerServer) error
- func (v *V2) ExchangePeer(ctx context.Context, req *schedulerv2.ExchangePeerRequest) (*schedulerv2.ExchangePeerResponse, error)
- func (v *V2) LeaveHost(ctx context.Context, req *schedulerv2.LeaveHostRequest) error
- func (v *V2) LeavePeer(ctx context.Context, req *schedulerv2.LeavePeerRequest) error
- func (v *V2) StatPeer(ctx context.Context, req *schedulerv2.StatPeerRequest) (*commonv2.Peer, error)
- func (v *V2) StatTask(ctx context.Context, req *schedulerv2.StatTaskRequest) (*commonv2.Task, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type V1 ¶ added in v2.0.9
type V1 struct {
// contains filtered or unexported fields
}
V1 is the interface for v1 version of the service.
func NewV1 ¶ added in v2.0.9
func NewV1( cfg *config.Config, resource resource.Resource, scheduling scheduling.Scheduling, dynconfig config.DynconfigInterface, storage storage.Storage, ) *V1
New v1 version of service instance.
func (*V1) AnnounceHost ¶ added in v2.0.9
func (v *V1) AnnounceHost(ctx context.Context, req *schedulerv1.AnnounceHostRequest) error
AnnounceHost announces host to scheduler.
func (*V1) AnnounceTask ¶ added in v2.0.9
func (v *V1) AnnounceTask(ctx context.Context, req *schedulerv1.AnnounceTaskRequest) error
AnnounceTask informs scheduler a peer has completed task.
func (*V1) LeaveHost ¶ added in v2.0.9
func (v *V1) LeaveHost(ctx context.Context, req *schedulerv1.LeaveHostRequest) error
LeaveHost releases host in scheduler.
func (*V1) LeaveTask ¶ added in v2.0.9
func (v *V1) LeaveTask(ctx context.Context, req *schedulerv1.PeerTarget) error
LeaveTask releases peer in scheduler.
func (*V1) RegisterPeerTask ¶ added in v2.0.9
func (v *V1) RegisterPeerTask(ctx context.Context, req *schedulerv1.PeerTaskRequest) (*schedulerv1.RegisterResult, error)
RegisterPeerTask registers peer and triggers seed peer download task.
func (*V1) ReportPeerResult ¶ added in v2.0.9
func (v *V1) ReportPeerResult(ctx context.Context, req *schedulerv1.PeerResult) error
ReportPeerResult handles peer result reported by dfdaemon.
func (*V1) ReportPieceResult ¶ added in v2.0.9
func (v *V1) ReportPieceResult(stream schedulerv1.Scheduler_ReportPieceResultServer) error
ReportPieceResult handles the piece information reported by dfdaemon.
func (*V1) StatTask ¶ added in v2.0.9
func (v *V1) StatTask(ctx context.Context, req *schedulerv1.StatTaskRequest) (*schedulerv1.Task, error)
StatTask checks the current state of the task.
type V2 ¶ added in v2.0.9
type V2 struct {
// contains filtered or unexported fields
}
TODO Implement v2 version of the service functions. V2 is the interface for v2 version of the service.
func NewV2 ¶ added in v2.0.9
func NewV2( cfg *config.Config, resource resource.Resource, scheduling scheduling.Scheduling, dynconfig config.DynconfigInterface, storage storage.Storage, ) *V2
New v2 version of service instance.
func (*V2) AnnounceHost ¶ added in v2.0.9
func (v *V2) AnnounceHost(ctx context.Context, req *schedulerv2.AnnounceHostRequest) error
AnnounceHost announces host to scheduler.
func (*V2) AnnouncePeer ¶ added in v2.0.9
func (v *V2) AnnouncePeer(stream schedulerv2.Scheduler_AnnouncePeerServer) error
AnnouncePeer announces peer to scheduler.
func (*V2) ExchangePeer ¶ added in v2.0.9
func (v *V2) ExchangePeer(ctx context.Context, req *schedulerv2.ExchangePeerRequest) (*schedulerv2.ExchangePeerResponse, error)
TODO exchange peer api definition. ExchangePeer exchanges peer information.
func (*V2) LeaveHost ¶ added in v2.0.9
func (v *V2) LeaveHost(ctx context.Context, req *schedulerv2.LeaveHostRequest) error
LeaveHost releases host in scheduler.
func (*V2) LeavePeer ¶ added in v2.0.9
func (v *V2) LeavePeer(ctx context.Context, req *schedulerv2.LeavePeerRequest) error
LeavePeer releases peer in scheduler.
func (*V2) StatPeer ¶ added in v2.0.9
func (v *V2) StatPeer(ctx context.Context, req *schedulerv2.StatPeerRequest) (*commonv2.Peer, error)
Checks information of peer.
func (*V2) StatTask ¶ added in v2.0.9
func (v *V2) StatTask(ctx context.Context, req *schedulerv2.StatTaskRequest) (*commonv2.Task, error)
Checks information of task.