set priority to optional (was extra)
[debian/orchestra.git] / src / player / task_request.go
1 // task_request.go
2 //
3
4 package main
5
6 import (
7         o "orchestra"
8 )
9
10 type TaskRequest struct {
11         Id              uint64                          `json:"id"`
12         Score           string                          `json:"score"`
13         Params          map[string]string               `json:"params"`
14         MyResponse      *TaskResponse                   `json:"response"`
15 }
16
17 func NewTaskRequest() (req *TaskRequest) {
18         req = new(TaskRequest)
19         return req
20 }
21
22 /* Map a wire task to an internal Task Request.
23 */
24 func TaskFromProto(ptr *o.ProtoTaskRequest) (t *TaskRequest) {
25         t = NewTaskRequest()
26         
27         t.Score = *(ptr.Jobname)
28         t.Id = *(ptr.Id)
29         t.Params = o.MapFromProtoJobParameters(ptr.Parameters)
30
31         return t
32 }
33