.
This commit is contained in:
31
task/rpc_impl.go
Normal file
31
task/rpc_impl.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
pb "loafle.com/overflow/central_api_gateway/task"
|
||||
"loafle.com/overflow/central_api_gateway/commons"
|
||||
"context"
|
||||
)
|
||||
|
||||
|
||||
type TaskServerImpl struct {
|
||||
}
|
||||
|
||||
func (s *TaskServerImpl) requestTask(c context.Context, in *pb.Empty) (*pb.TaskList, error) {
|
||||
|
||||
output := &pb.TaskList{}
|
||||
|
||||
tasks := make([]*pb.TaskInfo, 0)
|
||||
|
||||
//FIXME
|
||||
for i := 0; i < 5 ; i++ {
|
||||
task := &pb.TaskInfo{}
|
||||
task.TaskId = string(i)
|
||||
task.Command = commons.TaskEventType_TASK_POL_INTERVAL_UPDATE
|
||||
tasks = append(tasks, task)
|
||||
|
||||
}
|
||||
output.TaskList = tasks
|
||||
|
||||
return output, nil
|
||||
}
|
||||
|
||||
5
task/task.go
Normal file
5
task/task.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package task
|
||||
|
||||
type taskSupplier struct {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user