diff --git a/examples/hello/main.go b/examples/hello/main.go index 06c3a30..87b6082 100644 --- a/examples/hello/main.go +++ b/examples/hello/main.go @@ -46,10 +46,10 @@ func HelloHandlers() agent.Handlers { func HelloA(tick agent.Ticker) (behavior3go.Status, error) { var p *Player - one := tick.Marget().InviteAcc() + one := tick.Market().InviteAcc() if one == nil { p = NewPlayer(xid.New().String()) - tick.Marget().UseAcc(p) + tick.Market().UseAcc(p) fmt.Println("new player id", p.ID()) } else { p = one.(*Player) @@ -66,15 +66,15 @@ func HelloB(tick agent.Ticker) (behavior3go.Status, error) { func HelloC(tick agent.Ticker) (behavior3go.Status, error) { p := tick.Blackboard().GetMem("player").(*Player) - if tick.Marget().Index()%2 == 0 { - m := tick.Marget().InviteOne() + if tick.Market().Index()%2 == 0 { + m := tick.Market().InviteOne() if m != nil { fmt.Println("invite player success: ", m.(*Player).id) } else { fmt.Println("invite player failed") } } else { - tick.Marget().JoinOne(p) + tick.Market().JoinOne(p) fmt.Println("player join team: ", p.id) } return behavior3go.SUCCESS, nil @@ -93,14 +93,14 @@ func HelloE(tick agent.Ticker) (behavior3go.Status, error) { func newUser(tick agent.Ticker) (behavior3go.Status, error) { player := NewPlayer(xid.New().String()) - tick.Marget().PushOne(player) + tick.Market().PushOne(player) tick.Blackboard().SetMem("userId", player.id) return behavior3go.SUCCESS, nil } func addFriend(tick agent.Ticker) (behavior3go.Status, error) { userID := tick.Blackboard().GetMem("userId").(string) - one := tick.Marget().RequireOne(func(one agent.One) bool { + one := tick.Market().RequireOne(func(one agent.One) bool { player := one.(*Player) return player.ID() != userID }) @@ -114,12 +114,12 @@ func addFriend(tick agent.Ticker) (behavior3go.Status, error) { } func buildTeam(tick agent.Ticker) (behavior3go.Status, error) { - index := tick.Marget().Index() + index := tick.Market().Index() userID := tick.Blackboard().GetMem("userId").(string) if index%2 == 1 { - tick.Marget().JoinOne(NewPlayer(userID)) + tick.Market().JoinOne(NewPlayer(userID)) } else { - one := tick.Marget().InviteOne() + one := tick.Market().InviteOne() if one == nil { fmt.Println("no found player to build team") } else { diff --git a/pkg/agent/manager.go b/pkg/agent/manager.go index 1211249..4e9034c 100644 --- a/pkg/agent/manager.go +++ b/pkg/agent/manager.go @@ -154,7 +154,8 @@ func (m *manager) startExecutor(executor *executor, market *Market) { withStatPID(actuaryID). withBeTree(executor.treeCreator()). withMarket(market). - withAlert(m.alert) + withAlert(m.alert). + withParams(executor.plan.Params) if i%parallel == 0 && i/parallel > 0 { <-ticker.C } diff --git a/pkg/agent/robot.go b/pkg/agent/robot.go index 2fdcbce..ab5d79a 100644 --- a/pkg/agent/robot.go +++ b/pkg/agent/robot.go @@ -23,6 +23,7 @@ type job struct { ctx context.Context market *Market alert Alert + params map[string]string } func newJob() *job { @@ -59,6 +60,19 @@ func (t *job) withAlert(alert Alert) *job { return t } +func (t *job) withParams(params map[string]string) *job { + t.params = params + return t +} + +func (t *job) newBoard() *core.Blackboard { + board := core.NewBlackboard() + for key, val := range t.params { + board.SetMem(key, val) + } + return board +} + type robot struct { task *job } @@ -70,7 +84,7 @@ func newRobot(j *job) *robot { func (r *robot) execute(rootCtx *actor.RootContext) { start := time.Now() outcome := transfer.Outcome{Name: "whole_process"} - board := core.NewBlackboard() + board := r.task.newBoard() tick := NewTick() tick.market = r.task.market tick.ctx = r.task.ctx diff --git a/pkg/agent/tick.go b/pkg/agent/tick.go index 184e7f2..fe55c02 100644 --- a/pkg/agent/tick.go +++ b/pkg/agent/tick.go @@ -35,6 +35,15 @@ func (s *Signal) Slave() <-chan One { return s.market.getSlave() } +type ParamNotFound struct { +} + +func (p ParamNotFound) Error() string { + return "NotFoundParam" +} + +var paramError = ParamNotFound{} + type One interface { ID() string } @@ -174,6 +183,10 @@ type Ticker interface { actorCtx() *actor.RootContext RecvTime(unixNano string) SendTime(unixNano string) + GetParamInt(key string) (int, error) + GetParamBool(key string) (bool, error) + GetParamFloat(key string) (float64, error) + GetParamString(key string) (string, error) } type Tick struct { @@ -242,6 +255,66 @@ func (t *Tick) SendAlertMsg(msg *ErrMsg) error { return nil } +func (t *Tick) GetParamString(key string) (string, error) { + val := t.Blackboard().GetMem(key) + if val == nil { + return "", paramError + } + rs, ok := val.(string) + if !ok { + return "", paramError + } + return rs, nil +} + +func (t *Tick) GetParamInt(key string) (int, error) { + val := t.Blackboard().GetMem(key) + if val == nil { + return 0, paramError + } + str, ok := val.(string) + if !ok { + return 0, paramError + } + num, err := strconv.Atoi(str) + if err != nil { + return 0, err + } + return num, nil +} + +func (t *Tick) GetParamBool(key string) (bool, error) { + val := t.Blackboard().GetMem(key) + if val == nil { + return false, paramError + } + str, ok := val.(string) + if !ok { + return false, paramError + } + rs, err := strconv.ParseBool(str) + if err != nil { + return false, err + } + return rs, nil +} + +func (t *Tick) GetParamFloat(key string) (float64, error) { + val := t.Blackboard().GetMem(key) + if val == nil { + return 0, paramError + } + str, ok := val.(string) + if !ok { + return 0, paramError + } + rs, err := strconv.ParseFloat(str, 64) + if err != nil { + return 0, err + } + return rs, nil +} + func strToInt64(s string) int64 { v, err := strconv.ParseInt(s, 10, 64) if err != nil { diff --git a/pkg/transfer/transfer.pb.go b/pkg/transfer/transfer.pb.go index dd8e5ef..4f69129 100644 --- a/pkg/transfer/transfer.pb.go +++ b/pkg/transfer/transfer.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.27.1 // protoc v3.13.0 // source: transfer.proto @@ -239,10 +239,11 @@ type Plan struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TreeName string `protobuf:"bytes,1,opt,name=treeName,proto3" json:"treeName,omitempty"` - RobotNum int32 `protobuf:"varint,2,opt,name=robotNum,proto3" json:"robotNum,omitempty"` - Parallel int32 `protobuf:"varint,3,opt,name=parallel,proto3" json:"parallel,omitempty"` - Interval int32 `protobuf:"varint,4,opt,name=interval,proto3" json:"interval,omitempty"` + TreeName string `protobuf:"bytes,1,opt,name=treeName,proto3" json:"treeName,omitempty"` + RobotNum int32 `protobuf:"varint,2,opt,name=robotNum,proto3" json:"robotNum,omitempty"` + Parallel int32 `protobuf:"varint,3,opt,name=parallel,proto3" json:"parallel,omitempty"` + Interval int32 `protobuf:"varint,4,opt,name=interval,proto3" json:"interval,omitempty"` + Params map[string]string `protobuf:"bytes,5,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *Plan) Reset() { @@ -305,6 +306,13 @@ func (x *Plan) GetInterval() int32 { return 0 } +func (x *Plan) GetParams() map[string]string { + if x != nil { + return x.Params + } + return nil +} + type Event struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -953,132 +961,138 @@ var file_transfer_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x22, 0x76, 0x0a, 0x04, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x74, - 0x72, 0x65, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, - 0x72, 0x65, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f, 0x62, 0x6f, 0x74, - 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x6f, 0x62, 0x6f, 0x74, - 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x12, - 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0xd4, 0x01, 0x0a, 0x05, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, - 0x6c, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, - 0x6c, 0x65, 0x6c, 0x12, 0x3c, 0x0a, 0x0c, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x0c, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x22, 0xdc, 0x01, 0x0a, 0x04, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x1a, 0x0a, 0x08, + 0x74, 0x72, 0x65, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x74, 0x72, 0x65, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f, 0x62, 0x6f, + 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x6f, 0x62, 0x6f, + 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, + 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x29, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x50, + 0x6c, 0x61, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x22, 0x64, 0x0a, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x12, 0x18, 0x0a, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x24, 0x0a, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, - 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x69, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x70, 0x69, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x79, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x22, 0xf8, 0x03, 0x0a, 0x08, 0x51, 0x75, - 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4e, - 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4e, - 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, - 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x76, 0x67, 0x54, 0x69, 0x6d, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x76, 0x67, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x35, 0x30, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x6c, 0x65, 0x35, 0x30, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x31, 0x30, - 0x30, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x65, 0x31, 0x30, 0x30, - 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x32, 0x30, 0x30, 0x6d, 0x73, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x65, 0x32, 0x30, 0x30, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, - 0x6c, 0x65, 0x35, 0x30, 0x30, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, - 0x65, 0x35, 0x30, 0x30, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x65, 0x31, 0x73, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x6c, 0x65, 0x31, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x65, - 0x32, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x6c, 0x65, 0x32, 0x73, 0x12, 0x12, - 0x0a, 0x04, 0x6c, 0x65, 0x35, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x6c, 0x65, - 0x35, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x31, 0x30, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x6c, 0x65, 0x31, 0x30, 0x73, 0x12, 0x33, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x4d, 0x61, 0x70, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x51, 0x75, 0x61, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x12, 0x1c, 0x0a, - 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x06, 0x2e, 0x43, - 0x4c, 0x41, 0x53, 0x53, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x1a, 0x47, 0x0a, 0x0d, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x20, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfa, 0x01, 0x0a, 0x0a, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, - 0x69, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, - 0x73, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, - 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, - 0x69, 0x65, 0x73, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x45, 0x0a, 0x0c, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x0a, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x51, 0x75, - 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0xb1, 0x01, 0x0a, 0x09, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x0b, 0x68, - 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x09, 0x2e, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0b, 0x68, 0x51, 0x75, - 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x0b, 0x65, 0x51, 0x75, 0x61, - 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, - 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x0b, 0x65, 0x51, 0x75, 0x61, 0x6e, 0x74, - 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x07, 0x4f, 0x75, 0x74, 0x63, 0x6f, 0x6d, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, - 0x72, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x06, 0x2e, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, - 0x22, 0x62, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, - 0x61, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, - 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x24, - 0x0a, 0x08, 0x6f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x08, 0x2e, 0x4f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x63, - 0x6f, 0x6d, 0x65, 0x73, 0x2a, 0x72, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x12, 0x0f, - 0x0a, 0x0b, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x10, 0x00, 0x12, - 0x0e, 0x0a, 0x0a, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, - 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x10, 0x02, - 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x49, 0x4e, 0x49, 0x53, 0x48, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x10, - 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x43, 0x49, 0x52, 0x43, 0x4c, - 0x45, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x50, 0x41, - 0x52, 0x41, 0x4c, 0x4c, 0x45, 0x4c, 0x10, 0x05, 0x2a, 0x47, 0x0a, 0x06, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, - 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, - 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, - 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, - 0x04, 0x2a, 0x1f, 0x0a, 0x05, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x12, 0x0b, 0x0a, 0x07, 0x48, 0x41, - 0x4e, 0x44, 0x4c, 0x45, 0x52, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x56, 0x45, 0x4e, 0x54, - 0x10, 0x01, 0x32, 0x2c, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x72, 0x69, 0x65, 0x72, 0x12, 0x21, 0x0a, - 0x0b, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x4d, 0x61, 0x69, 0x6c, 0x12, 0x05, 0x2e, 0x4d, - 0x61, 0x69, 0x6c, 0x1a, 0x05, 0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, - 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x3b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x38, 0x01, 0x22, 0xd4, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x12, 0x3c, 0x0a, 0x0c, 0x65, 0x6e, + 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x65, 0x6e, 0x76, 0x69, + 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x45, 0x6e, 0x76, 0x69, + 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x64, 0x0a, 0x0a, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x49, + 0x44, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x24, 0x0a, 0x07, 0x72, 0x65, 0x70, + 0x6c, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x50, 0x6c, 0x61, + 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x07, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x22, + 0x5f, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x1c, 0x0a, 0x09, + 0x64, 0x65, 0x70, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x64, 0x65, 0x70, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, + 0x22, 0xf8, 0x03, 0x0a, 0x08, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, + 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x61, 0x78, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x76, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, + 0x61, 0x76, 0x67, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x35, 0x30, 0x6d, + 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6c, 0x65, 0x35, 0x30, 0x6d, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x31, 0x30, 0x30, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x07, 0x6c, 0x65, 0x31, 0x30, 0x30, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x32, + 0x30, 0x30, 0x6d, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x65, 0x32, 0x30, + 0x30, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x65, 0x35, 0x30, 0x30, 0x6d, 0x73, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x65, 0x35, 0x30, 0x30, 0x6d, 0x73, 0x12, 0x12, 0x0a, + 0x04, 0x6c, 0x65, 0x31, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x6c, 0x65, 0x31, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x65, 0x32, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x04, 0x6c, 0x65, 0x32, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x65, 0x35, 0x73, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x04, 0x6c, 0x65, 0x35, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x31, + 0x30, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x65, 0x31, 0x30, 0x73, 0x12, + 0x33, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x18, 0x0f, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x17, 0x2e, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x4d, 0x61, 0x70, 0x12, 0x1c, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x06, 0x2e, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x52, 0x05, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x1a, 0x47, 0x0a, 0x0d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x70, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x61, 0x72, 0x6b, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfa, 0x01, 0x0a, 0x0a, + 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x68, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x51, 0x75, + 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x12, 0x2c, + 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x45, 0x0a, 0x0c, + 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, + 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb1, 0x01, 0x0a, 0x09, 0x50, 0x6c, 0x61, + 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x65, + 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x62, + 0x65, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x0b, 0x68, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x52, 0x0b, 0x68, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, + 0x2b, 0x0a, 0x0b, 0x65, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, + 0x0b, 0x65, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0x88, 0x01, 0x0a, + 0x07, 0x4f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, + 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x12, 0x1c, 0x0a, 0x05, 0x63, 0x6c, 0x61, + 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x06, 0x2e, 0x43, 0x4c, 0x41, 0x53, 0x53, + 0x52, 0x05, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x62, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x08, 0x6f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x4f, 0x75, 0x74, 0x63, 0x6f, 0x6d, + 0x65, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x2a, 0x72, 0x0a, 0x06, 0x41, + 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x54, 0x41, 0x52, 0x54, 0x5f, 0x41, + 0x47, 0x45, 0x4e, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x41, + 0x47, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x50, 0x4f, 0x52, 0x54, + 0x5f, 0x44, 0x41, 0x54, 0x41, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x49, 0x4e, 0x49, 0x53, + 0x48, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x52, + 0x54, 0x5f, 0x43, 0x49, 0x52, 0x43, 0x4c, 0x45, 0x10, 0x04, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, + 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x50, 0x41, 0x52, 0x41, 0x4c, 0x4c, 0x45, 0x4c, 0x10, 0x05, 0x2a, + 0x47, 0x0a, 0x06, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x49, + 0x54, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, + 0x53, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x41, 0x49, 0x4c, 0x55, 0x52, 0x45, 0x10, 0x02, + 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x12, 0x09, 0x0a, + 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x2a, 0x1f, 0x0a, 0x05, 0x43, 0x4c, 0x41, 0x53, + 0x53, 0x12, 0x0b, 0x0a, 0x07, 0x48, 0x41, 0x4e, 0x44, 0x4c, 0x45, 0x52, 0x10, 0x00, 0x12, 0x09, + 0x0a, 0x05, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x32, 0x2c, 0x0a, 0x07, 0x43, 0x6f, 0x75, + 0x72, 0x69, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x4d, + 0x61, 0x69, 0x6c, 0x12, 0x05, 0x2e, 0x4d, 0x61, 0x69, 0x6c, 0x1a, 0x05, 0x2e, 0x4d, 0x61, 0x69, + 0x6c, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x0d, 0x5a, 0x0b, 0x2e, 0x2f, 0x3b, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1094,7 +1108,7 @@ func file_transfer_proto_rawDescGZIP() []byte { } var file_transfer_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_transfer_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_transfer_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_transfer_proto_goTypes = []interface{}{ (ACTION)(0), // 0: ACTION (STATUS)(0), // 1: STATUS @@ -1109,34 +1123,36 @@ var file_transfer_proto_goTypes = []interface{}{ (*PlanReply)(nil), // 10: PlanReply (*Outcome)(nil), // 11: Outcome (*Report)(nil), // 12: Report - nil, // 13: Event.EnvironmentsEntry - nil, // 14: Quantity.ErrorMapEntry - nil, // 15: Quantities.HandlerEntry - nil, // 16: Quantities.EventEntry + nil, // 13: Plan.ParamsEntry + nil, // 14: Event.EnvironmentsEntry + nil, // 15: Quantity.ErrorMapEntry + nil, // 16: Quantities.HandlerEntry + nil, // 17: Quantities.EventEntry } var file_transfer_proto_depIdxs = []int32{ 0, // 0: Mail.action:type_name -> ACTION - 13, // 1: Event.environments:type_name -> Event.EnvironmentsEntry - 10, // 2: EventReply.replies:type_name -> PlanReply - 14, // 3: Quantity.errorMap:type_name -> Quantity.ErrorMapEntry - 2, // 4: Quantity.class:type_name -> CLASS - 15, // 5: Quantities.handler:type_name -> Quantities.HandlerEntry - 16, // 6: Quantities.event:type_name -> Quantities.EventEntry - 8, // 7: PlanReply.hQuantities:type_name -> Quantity - 8, // 8: PlanReply.eQuantities:type_name -> Quantity - 1, // 9: Outcome.status:type_name -> STATUS - 2, // 10: Outcome.class:type_name -> CLASS - 11, // 11: Report.outcomes:type_name -> Outcome - 7, // 12: Quantity.ErrorMapEntry.value:type_name -> ErrorMark - 8, // 13: Quantities.HandlerEntry.value:type_name -> Quantity - 8, // 14: Quantities.EventEntry.value:type_name -> Quantity - 3, // 15: Courier.DeliverMail:input_type -> Mail - 3, // 16: Courier.DeliverMail:output_type -> Mail - 16, // [16:17] is the sub-list for method output_type - 15, // [15:16] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name + 13, // 1: Plan.params:type_name -> Plan.ParamsEntry + 14, // 2: Event.environments:type_name -> Event.EnvironmentsEntry + 10, // 3: EventReply.replies:type_name -> PlanReply + 15, // 4: Quantity.errorMap:type_name -> Quantity.ErrorMapEntry + 2, // 5: Quantity.class:type_name -> CLASS + 16, // 6: Quantities.handler:type_name -> Quantities.HandlerEntry + 17, // 7: Quantities.event:type_name -> Quantities.EventEntry + 8, // 8: PlanReply.hQuantities:type_name -> Quantity + 8, // 9: PlanReply.eQuantities:type_name -> Quantity + 1, // 10: Outcome.status:type_name -> STATUS + 2, // 11: Outcome.class:type_name -> CLASS + 11, // 12: Report.outcomes:type_name -> Outcome + 7, // 13: Quantity.ErrorMapEntry.value:type_name -> ErrorMark + 8, // 14: Quantities.HandlerEntry.value:type_name -> Quantity + 8, // 15: Quantities.EventEntry.value:type_name -> Quantity + 3, // 16: Courier.DeliverMail:input_type -> Mail + 3, // 17: Courier.DeliverMail:output_type -> Mail + 17, // [17:18] is the sub-list for method output_type + 16, // [16:17] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_transfer_proto_init() } @@ -1272,7 +1288,7 @@ func file_transfer_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_transfer_proto_rawDesc, NumEnums: 3, - NumMessages: 14, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/transfer/transfer.proto b/pkg/transfer/transfer.proto index b74cbd9..cef12ab 100644 --- a/pkg/transfer/transfer.proto +++ b/pkg/transfer/transfer.proto @@ -21,6 +21,7 @@ message Plan { int32 robotNum = 2; int32 parallel = 3; int32 interval = 4; + map params = 5; } message Event { diff --git a/pkg/transfer/transfer_grpc.pb.go b/pkg/transfer/transfer_grpc.pb.go index 1725b55..7445a69 100644 --- a/pkg/transfer/transfer_grpc.pb.go +++ b/pkg/transfer/transfer_grpc.pb.go @@ -11,6 +11,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // CourierClient is the client API for Courier service. @@ -29,7 +30,7 @@ func NewCourierClient(cc grpc.ClientConnInterface) CourierClient { } func (c *courierClient) DeliverMail(ctx context.Context, opts ...grpc.CallOption) (Courier_DeliverMailClient, error) { - stream, err := c.cc.NewStream(ctx, &_Courier_serviceDesc.Streams[0], "/Courier/DeliverMail", opts...) + stream, err := c.cc.NewStream(ctx, &Courier_ServiceDesc.Streams[0], "/Courier/DeliverMail", opts...) if err != nil { return nil, err } @@ -84,7 +85,7 @@ type UnsafeCourierServer interface { } func RegisterCourierServer(s grpc.ServiceRegistrar, srv CourierServer) { - s.RegisterService(&_Courier_serviceDesc, srv) + s.RegisterService(&Courier_ServiceDesc, srv) } func _Courier_DeliverMail_Handler(srv interface{}, stream grpc.ServerStream) error { @@ -113,7 +114,10 @@ func (x *courierDeliverMailServer) Recv() (*Mail, error) { return m, nil } -var _Courier_serviceDesc = grpc.ServiceDesc{ +// Courier_ServiceDesc is the grpc.ServiceDesc for Courier service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Courier_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Courier", HandlerType: (*CourierServer)(nil), Methods: []grpc.MethodDesc{},