Documentation ¶
Index ¶
- func New(service *service.Service, opts ...grpc.ServerOption) *grpc.Server
- type Server
- func (s *Server) AnnounceHost(ctx context.Context, req *schedulerv1.AnnounceHostRequest) (*empty.Empty, error)
- func (s *Server) AnnounceTask(ctx context.Context, req *schedulerv1.AnnounceTaskRequest) (*empty.Empty, error)
- func (s *Server) LeaveHost(ctx context.Context, req *schedulerv1.LeaveHostRequest) (*empty.Empty, error)
- func (s *Server) LeaveTask(ctx context.Context, req *schedulerv1.PeerTarget) (*empty.Empty, error)
- func (s *Server) RegisterPeerTask(ctx context.Context, req *schedulerv1.PeerTaskRequest) (*schedulerv1.RegisterResult, error)
- func (s *Server) ReportPeerResult(ctx context.Context, req *schedulerv1.PeerResult) (*empty.Empty, error)
- func (s *Server) ReportPieceResult(stream schedulerv1.Scheduler_ReportPieceResultServer) error
- func (s *Server) StatTask(ctx context.Context, req *schedulerv1.StatTaskRequest) (*schedulerv1.Task, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶ added in v2.0.2
type Server struct {
// contains filtered or unexported fields
}
Server is grpc server.
func (*Server) AnnounceHost ¶ added in v2.0.8
func (s *Server) AnnounceHost(ctx context.Context, req *schedulerv1.AnnounceHostRequest) (*empty.Empty, error)
AnnounceHost announces host to scheduler.
func (*Server) AnnounceTask ¶ added in v2.0.3
func (s *Server) AnnounceTask(ctx context.Context, req *schedulerv1.AnnounceTaskRequest) (*empty.Empty, error)
AnnounceTask informs scheduler a peer has completed task.
func (*Server) LeaveHost ¶ added in v2.0.8
func (s *Server) LeaveHost(ctx context.Context, req *schedulerv1.LeaveHostRequest) (*empty.Empty, error)
LeaveHost releases host in scheduler.
func (*Server) LeaveTask ¶ added in v2.0.2
func (s *Server) LeaveTask(ctx context.Context, req *schedulerv1.PeerTarget) (*empty.Empty, error)
LeaveTask makes the peer unschedulable.
func (*Server) RegisterPeerTask ¶ added in v2.0.2
func (s *Server) RegisterPeerTask(ctx context.Context, req *schedulerv1.PeerTaskRequest) (*schedulerv1.RegisterResult, error)
RegisterPeerTask registers peer and triggers seed peer download task.
func (*Server) ReportPeerResult ¶ added in v2.0.2
func (s *Server) ReportPeerResult(ctx context.Context, req *schedulerv1.PeerResult) (*empty.Empty, error)
ReportPeerResult handles peer result reported by dfdaemon.
func (*Server) ReportPieceResult ¶ added in v2.0.2
func (s *Server) ReportPieceResult(stream schedulerv1.Scheduler_ReportPieceResultServer) error
ReportPieceResult handles the piece information reported by dfdaemon.
func (*Server) StatTask ¶ added in v2.0.3
func (s *Server) StatTask(ctx context.Context, req *schedulerv1.StatTaskRequest) (*schedulerv1.Task, error)
StatTask checks if the given task exists.
Click to show internal directories.
Click to hide internal directories.