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)
- func (v *V1) SyncProbes(stream schedulerv1.Scheduler_SyncProbesServer) 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)
- func (v *V2) SyncProbes(stream schedulerv2.Scheduler_SyncProbesServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type V1 ¶
type V1 struct {
// contains filtered or unexported fields
}
V1 is the interface for v1 version of the service.
func NewV1 ¶
func NewV1( cfg *config.Config, resource resource.Resource, scheduling scheduling.Scheduling, dynconfig config.DynconfigInterface, storage storage.Storage, networktopology networktopology.NetworkTopology, ) *V1
New v1 version of service instance.
func (*V1) AnnounceHost ¶
func (v *V1) AnnounceHost(ctx context.Context, req *schedulerv1.AnnounceHostRequest) error
AnnounceHost announces host to scheduler.
func (*V1) AnnounceTask ¶
func (v *V1) AnnounceTask(ctx context.Context, req *schedulerv1.AnnounceTaskRequest) error
AnnounceTask informs scheduler a peer has completed task.
func (*V1) LeaveHost ¶
func (v *V1) LeaveHost(ctx context.Context, req *schedulerv1.LeaveHostRequest) error
LeaveHost releases host in scheduler.
func (*V1) LeaveTask ¶
func (v *V1) LeaveTask(ctx context.Context, req *schedulerv1.PeerTarget) error
LeaveTask releases peer in scheduler.
func (*V1) RegisterPeerTask ¶
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 ¶
func (v *V1) ReportPeerResult(ctx context.Context, req *schedulerv1.PeerResult) error
ReportPeerResult handles peer result reported by dfdaemon.
func (*V1) ReportPieceResult ¶
func (v *V1) ReportPieceResult(stream schedulerv1.Scheduler_ReportPieceResultServer) error
ReportPieceResult handles the piece information reported by dfdaemon.
func (*V1) StatTask ¶
func (v *V1) StatTask(ctx context.Context, req *schedulerv1.StatTaskRequest) (*schedulerv1.Task, error)
StatTask checks the current state of the task.
func (*V1) SyncProbes ¶
func (v *V1) SyncProbes(stream schedulerv1.Scheduler_SyncProbesServer) error
SyncProbes sync probes of the host.
type V2 ¶
type V2 struct {
// contains filtered or unexported fields
}
V2 is the interface for v2 version of the service.
func NewV2 ¶
func NewV2( cfg *config.Config, resource resource.Resource, scheduling scheduling.Scheduling, dynconfig config.DynconfigInterface, storage storage.Storage, networkTopology networktopology.NetworkTopology, ) *V2
New v2 version of service instance.
func (*V2) AnnounceHost ¶
func (v *V2) AnnounceHost(ctx context.Context, req *schedulerv2.AnnounceHostRequest) error
AnnounceHost announces host to scheduler.
func (*V2) AnnouncePeer ¶
func (v *V2) AnnouncePeer(stream schedulerv2.Scheduler_AnnouncePeerServer) error
AnnouncePeer announces peer to scheduler.
func (*V2) ExchangePeer ¶
func (v *V2) ExchangePeer(ctx context.Context, req *schedulerv2.ExchangePeerRequest) (*schedulerv2.ExchangePeerResponse, error)
TODO Implement function. ExchangePeer exchanges peer information.
func (*V2) LeaveHost ¶
func (v *V2) LeaveHost(ctx context.Context, req *schedulerv2.LeaveHostRequest) error
LeaveHost releases host in scheduler.
func (*V2) LeavePeer ¶
func (v *V2) LeavePeer(ctx context.Context, req *schedulerv2.LeavePeerRequest) error
LeavePeer releases peer in scheduler.
func (*V2) StatPeer ¶
func (v *V2) StatPeer(ctx context.Context, req *schedulerv2.StatPeerRequest) (*commonv2.Peer, error)
StatPeer checks information of peer.
func (*V2) StatTask ¶
func (v *V2) StatTask(ctx context.Context, req *schedulerv2.StatTaskRequest) (*commonv2.Task, error)
StatTask checks information of task.
func (*V2) SyncProbes ¶
func (v *V2) SyncProbes(stream schedulerv2.Scheduler_SyncProbesServer) error
SyncProbes sync probes of the host.