snakesimulator.pb.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: snakesimulator.proto
  3. package snakesimulator
  4. import (
  5. context "context"
  6. fmt "fmt"
  7. proto "github.com/golang/protobuf/proto"
  8. grpc "google.golang.org/grpc"
  9. codes "google.golang.org/grpc/codes"
  10. status "google.golang.org/grpc/status"
  11. math "math"
  12. )
  13. // Reference imports to suppress errors if they are not otherwise used.
  14. var _ = proto.Marshal
  15. var _ = fmt.Errorf
  16. var _ = math.Inf
  17. // This is a compile-time assertion to ensure that this generated file
  18. // is compatible with the proto package it is being compiled against.
  19. // A compilation error at this line likely means your copy of the
  20. // proto package needs to be updated.
  21. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
  22. type Direction int32
  23. const (
  24. Direction_Unknown Direction = 0
  25. Direction_Up Direction = 1
  26. Direction_Down Direction = 2
  27. Direction_Left Direction = 3
  28. Direction_Right Direction = 4
  29. )
  30. var Direction_name = map[int32]string{
  31. 0: "Unknown",
  32. 1: "Up",
  33. 2: "Down",
  34. 3: "Left",
  35. 4: "Right",
  36. }
  37. var Direction_value = map[string]int32{
  38. "Unknown": 0,
  39. "Up": 1,
  40. "Down": 2,
  41. "Left": 3,
  42. "Right": 4,
  43. }
  44. func (x Direction) String() string {
  45. return proto.EnumName(Direction_name, int32(x))
  46. }
  47. func (Direction) EnumDescriptor() ([]byte, []int) {
  48. return fileDescriptor_b704e55df18a3970, []int{0}
  49. }
  50. type Point struct {
  51. X uint32 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"`
  52. Y uint32 `protobuf:"varint,2,opt,name=y,proto3" json:"y,omitempty"`
  53. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  54. XXX_unrecognized []byte `json:"-"`
  55. XXX_sizecache int32 `json:"-"`
  56. }
  57. func (m *Point) Reset() { *m = Point{} }
  58. func (m *Point) String() string { return proto.CompactTextString(m) }
  59. func (*Point) ProtoMessage() {}
  60. func (*Point) Descriptor() ([]byte, []int) {
  61. return fileDescriptor_b704e55df18a3970, []int{0}
  62. }
  63. func (m *Point) XXX_Unmarshal(b []byte) error {
  64. return xxx_messageInfo_Point.Unmarshal(m, b)
  65. }
  66. func (m *Point) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  67. return xxx_messageInfo_Point.Marshal(b, m, deterministic)
  68. }
  69. func (m *Point) XXX_Merge(src proto.Message) {
  70. xxx_messageInfo_Point.Merge(m, src)
  71. }
  72. func (m *Point) XXX_Size() int {
  73. return xxx_messageInfo_Point.Size(m)
  74. }
  75. func (m *Point) XXX_DiscardUnknown() {
  76. xxx_messageInfo_Point.DiscardUnknown(m)
  77. }
  78. var xxx_messageInfo_Point proto.InternalMessageInfo
  79. func (m *Point) GetX() uint32 {
  80. if m != nil {
  81. return m.X
  82. }
  83. return 0
  84. }
  85. func (m *Point) GetY() uint32 {
  86. if m != nil {
  87. return m.Y
  88. }
  89. return 0
  90. }
  91. type Snake struct {
  92. Points []*Point `protobuf:"bytes,1,rep,name=points,proto3" json:"points,omitempty"`
  93. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  94. XXX_unrecognized []byte `json:"-"`
  95. XXX_sizecache int32 `json:"-"`
  96. }
  97. func (m *Snake) Reset() { *m = Snake{} }
  98. func (m *Snake) String() string { return proto.CompactTextString(m) }
  99. func (*Snake) ProtoMessage() {}
  100. func (*Snake) Descriptor() ([]byte, []int) {
  101. return fileDescriptor_b704e55df18a3970, []int{1}
  102. }
  103. func (m *Snake) XXX_Unmarshal(b []byte) error {
  104. return xxx_messageInfo_Snake.Unmarshal(m, b)
  105. }
  106. func (m *Snake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  107. return xxx_messageInfo_Snake.Marshal(b, m, deterministic)
  108. }
  109. func (m *Snake) XXX_Merge(src proto.Message) {
  110. xxx_messageInfo_Snake.Merge(m, src)
  111. }
  112. func (m *Snake) XXX_Size() int {
  113. return xxx_messageInfo_Snake.Size(m)
  114. }
  115. func (m *Snake) XXX_DiscardUnknown() {
  116. xxx_messageInfo_Snake.DiscardUnknown(m)
  117. }
  118. var xxx_messageInfo_Snake proto.InternalMessageInfo
  119. func (m *Snake) GetPoints() []*Point {
  120. if m != nil {
  121. return m.Points
  122. }
  123. return nil
  124. }
  125. type Field struct {
  126. Width uint32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"`
  127. Height uint32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
  128. Food *Point `protobuf:"bytes,3,opt,name=food,proto3" json:"food,omitempty"`
  129. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  130. XXX_unrecognized []byte `json:"-"`
  131. XXX_sizecache int32 `json:"-"`
  132. }
  133. func (m *Field) Reset() { *m = Field{} }
  134. func (m *Field) String() string { return proto.CompactTextString(m) }
  135. func (*Field) ProtoMessage() {}
  136. func (*Field) Descriptor() ([]byte, []int) {
  137. return fileDescriptor_b704e55df18a3970, []int{2}
  138. }
  139. func (m *Field) XXX_Unmarshal(b []byte) error {
  140. return xxx_messageInfo_Field.Unmarshal(m, b)
  141. }
  142. func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  143. return xxx_messageInfo_Field.Marshal(b, m, deterministic)
  144. }
  145. func (m *Field) XXX_Merge(src proto.Message) {
  146. xxx_messageInfo_Field.Merge(m, src)
  147. }
  148. func (m *Field) XXX_Size() int {
  149. return xxx_messageInfo_Field.Size(m)
  150. }
  151. func (m *Field) XXX_DiscardUnknown() {
  152. xxx_messageInfo_Field.DiscardUnknown(m)
  153. }
  154. var xxx_messageInfo_Field proto.InternalMessageInfo
  155. func (m *Field) GetWidth() uint32 {
  156. if m != nil {
  157. return m.Width
  158. }
  159. return 0
  160. }
  161. func (m *Field) GetHeight() uint32 {
  162. if m != nil {
  163. return m.Height
  164. }
  165. return 0
  166. }
  167. func (m *Field) GetFood() *Point {
  168. if m != nil {
  169. return m.Food
  170. }
  171. return nil
  172. }
  173. type Stats struct {
  174. Generation uint32 `protobuf:"varint,1,opt,name=generation,proto3" json:"generation,omitempty"`
  175. Individual uint32 `protobuf:"varint,2,opt,name=individual,proto3" json:"individual,omitempty"`
  176. Move uint32 `protobuf:"varint,3,opt,name=move,proto3" json:"move,omitempty"`
  177. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  178. XXX_unrecognized []byte `json:"-"`
  179. XXX_sizecache int32 `json:"-"`
  180. }
  181. func (m *Stats) Reset() { *m = Stats{} }
  182. func (m *Stats) String() string { return proto.CompactTextString(m) }
  183. func (*Stats) ProtoMessage() {}
  184. func (*Stats) Descriptor() ([]byte, []int) {
  185. return fileDescriptor_b704e55df18a3970, []int{3}
  186. }
  187. func (m *Stats) XXX_Unmarshal(b []byte) error {
  188. return xxx_messageInfo_Stats.Unmarshal(m, b)
  189. }
  190. func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  191. return xxx_messageInfo_Stats.Marshal(b, m, deterministic)
  192. }
  193. func (m *Stats) XXX_Merge(src proto.Message) {
  194. xxx_messageInfo_Stats.Merge(m, src)
  195. }
  196. func (m *Stats) XXX_Size() int {
  197. return xxx_messageInfo_Stats.Size(m)
  198. }
  199. func (m *Stats) XXX_DiscardUnknown() {
  200. xxx_messageInfo_Stats.DiscardUnknown(m)
  201. }
  202. var xxx_messageInfo_Stats proto.InternalMessageInfo
  203. func (m *Stats) GetGeneration() uint32 {
  204. if m != nil {
  205. return m.Generation
  206. }
  207. return 0
  208. }
  209. func (m *Stats) GetIndividual() uint32 {
  210. if m != nil {
  211. return m.Individual
  212. }
  213. return 0
  214. }
  215. func (m *Stats) GetMove() uint32 {
  216. if m != nil {
  217. return m.Move
  218. }
  219. return 0
  220. }
  221. type Speed struct {
  222. Speed uint32 `protobuf:"varint,1,opt,name=speed,proto3" json:"speed,omitempty"`
  223. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  224. XXX_unrecognized []byte `json:"-"`
  225. XXX_sizecache int32 `json:"-"`
  226. }
  227. func (m *Speed) Reset() { *m = Speed{} }
  228. func (m *Speed) String() string { return proto.CompactTextString(m) }
  229. func (*Speed) ProtoMessage() {}
  230. func (*Speed) Descriptor() ([]byte, []int) {
  231. return fileDescriptor_b704e55df18a3970, []int{4}
  232. }
  233. func (m *Speed) XXX_Unmarshal(b []byte) error {
  234. return xxx_messageInfo_Speed.Unmarshal(m, b)
  235. }
  236. func (m *Speed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  237. return xxx_messageInfo_Speed.Marshal(b, m, deterministic)
  238. }
  239. func (m *Speed) XXX_Merge(src proto.Message) {
  240. xxx_messageInfo_Speed.Merge(m, src)
  241. }
  242. func (m *Speed) XXX_Size() int {
  243. return xxx_messageInfo_Speed.Size(m)
  244. }
  245. func (m *Speed) XXX_DiscardUnknown() {
  246. xxx_messageInfo_Speed.DiscardUnknown(m)
  247. }
  248. var xxx_messageInfo_Speed proto.InternalMessageInfo
  249. func (m *Speed) GetSpeed() uint32 {
  250. if m != nil {
  251. return m.Speed
  252. }
  253. return 0
  254. }
  255. type None struct {
  256. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  257. XXX_unrecognized []byte `json:"-"`
  258. XXX_sizecache int32 `json:"-"`
  259. }
  260. func (m *None) Reset() { *m = None{} }
  261. func (m *None) String() string { return proto.CompactTextString(m) }
  262. func (*None) ProtoMessage() {}
  263. func (*None) Descriptor() ([]byte, []int) {
  264. return fileDescriptor_b704e55df18a3970, []int{5}
  265. }
  266. func (m *None) XXX_Unmarshal(b []byte) error {
  267. return xxx_messageInfo_None.Unmarshal(m, b)
  268. }
  269. func (m *None) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  270. return xxx_messageInfo_None.Marshal(b, m, deterministic)
  271. }
  272. func (m *None) XXX_Merge(src proto.Message) {
  273. xxx_messageInfo_None.Merge(m, src)
  274. }
  275. func (m *None) XXX_Size() int {
  276. return xxx_messageInfo_None.Size(m)
  277. }
  278. func (m *None) XXX_DiscardUnknown() {
  279. xxx_messageInfo_None.DiscardUnknown(m)
  280. }
  281. var xxx_messageInfo_None proto.InternalMessageInfo
  282. func init() {
  283. proto.RegisterEnum("snakesimulator.Direction", Direction_name, Direction_value)
  284. proto.RegisterType((*Point)(nil), "snakesimulator.Point")
  285. proto.RegisterType((*Snake)(nil), "snakesimulator.Snake")
  286. proto.RegisterType((*Field)(nil), "snakesimulator.Field")
  287. proto.RegisterType((*Stats)(nil), "snakesimulator.Stats")
  288. proto.RegisterType((*Speed)(nil), "snakesimulator.Speed")
  289. proto.RegisterType((*None)(nil), "snakesimulator.None")
  290. }
  291. func init() { proto.RegisterFile("snakesimulator.proto", fileDescriptor_b704e55df18a3970) }
  292. var fileDescriptor_b704e55df18a3970 = []byte{
  293. // 357 bytes of a gzipped FileDescriptorProto
  294. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x6b, 0xfa, 0x40,
  295. 0x10, 0xc5, 0x5d, 0xcd, 0xe6, 0xab, 0xe3, 0x57, 0x09, 0x8b, 0x2d, 0x41, 0x68, 0x91, 0xed, 0xc5,
  296. 0x16, 0x2a, 0xc5, 0x42, 0x69, 0x4f, 0xbd, 0x48, 0x4f, 0xa5, 0x94, 0x04, 0x4f, 0xbd, 0x34, 0x6d,
  297. 0x56, 0x5d, 0xd4, 0xdd, 0x90, 0xac, 0xbf, 0xfe, 0xf4, 0xde, 0xca, 0x4e, 0x22, 0x58, 0x6d, 0xc1,
  298. 0xdb, 0xcc, 0xe4, 0xbd, 0xfd, 0xec, 0xbc, 0x2c, 0xb4, 0x32, 0x15, 0x4d, 0x45, 0x26, 0xe7, 0x8b,
  299. 0x59, 0x64, 0x74, 0xda, 0x4b, 0x52, 0x6d, 0x34, 0x6b, 0xfe, 0x9c, 0xf2, 0x0b, 0xa0, 0xaf, 0x5a,
  300. 0x2a, 0xc3, 0xfe, 0x03, 0x59, 0xfb, 0xa4, 0x43, 0xba, 0x8d, 0x80, 0xac, 0x6d, 0xb7, 0xf1, 0xcb,
  301. 0x79, 0xb7, 0xe1, 0x77, 0x40, 0x43, 0x6b, 0x63, 0xd7, 0xe0, 0x26, 0x56, 0x9d, 0xf9, 0xa4, 0x53,
  302. 0xe9, 0xd6, 0xfb, 0x27, 0xbd, 0x3d, 0x08, 0x9e, 0x15, 0x14, 0x22, 0xfe, 0x0e, 0xf4, 0x49, 0x8a,
  303. 0x59, 0xcc, 0x5a, 0x40, 0x57, 0x32, 0x36, 0x93, 0x02, 0x90, 0x37, 0xec, 0x14, 0xdc, 0x89, 0x90,
  304. 0xe3, 0x89, 0x29, 0x48, 0x45, 0xc7, 0x2e, 0xc1, 0x19, 0x69, 0x1d, 0xfb, 0x95, 0x0e, 0xf9, 0x9b,
  305. 0x81, 0x12, 0xfe, 0x06, 0x34, 0x34, 0x91, 0xc9, 0xd8, 0x39, 0xc0, 0x58, 0x28, 0x91, 0x46, 0x46,
  306. 0x6a, 0x55, 0x60, 0x76, 0x26, 0xf6, 0xbb, 0x54, 0xb1, 0x5c, 0xca, 0x78, 0x11, 0xcd, 0x0a, 0xde,
  307. 0xce, 0x84, 0x31, 0x70, 0xe6, 0x7a, 0x29, 0x90, 0xd9, 0x08, 0xb0, 0xe6, 0x67, 0x40, 0xc3, 0x44,
  308. 0x08, 0xbc, 0x7e, 0x66, 0x8b, 0xed, 0xf5, 0xb1, 0xe1, 0x2e, 0x38, 0x2f, 0x5a, 0x89, 0xab, 0x47,
  309. 0xa8, 0x0d, 0x64, 0x2a, 0x3e, 0x91, 0x53, 0x87, 0x7f, 0x43, 0x35, 0x55, 0x7a, 0xa5, 0xbc, 0x12,
  310. 0x73, 0xa1, 0x3c, 0x4c, 0x3c, 0xc2, 0xaa, 0xe0, 0x0c, 0xec, 0xa4, 0x6c, 0xab, 0x67, 0x31, 0x32,
  311. 0x5e, 0x85, 0xd5, 0x80, 0x06, 0x76, 0x5b, 0xcf, 0xe9, 0x7f, 0x11, 0x68, 0x62, 0xbe, 0xe1, 0x76,
  312. 0x47, 0x76, 0x0f, 0x14, 0xb7, 0x66, 0xad, 0xfd, 0xed, 0x2d, 0xb2, 0x7d, 0x90, 0x09, 0xda, 0x79,
  313. 0xe9, 0x86, 0x58, 0xe7, 0x28, 0xcf, 0xfc, 0x38, 0x27, 0xfe, 0xa0, 0xad, 0x33, 0xc3, 0x2c, 0x8f,
  314. 0x65, 0x5a, 0x31, 0x3a, 0x1f, 0xa0, 0x9a, 0x09, 0x93, 0x67, 0x75, 0x28, 0xb3, 0xe3, 0xf6, 0xaf,
  315. 0x67, 0xf2, 0xd2, 0x87, 0x8b, 0xcf, 0xf2, 0xf6, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x27, 0xde, 0x83,
  316. 0x77, 0xae, 0x02, 0x00, 0x00,
  317. }
  318. // Reference imports to suppress errors if they are not otherwise used.
  319. var _ context.Context
  320. var _ grpc.ClientConn
  321. // This is a compile-time assertion to ensure that this generated file
  322. // is compatible with the grpc package it is being compiled against.
  323. const _ = grpc.SupportPackageIsVersion4
  324. // SnakeSimulatorClient is the client API for SnakeSimulator service.
  325. //
  326. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  327. type SnakeSimulatorClient interface {
  328. Snake(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_SnakeClient, error)
  329. Field(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_FieldClient, error)
  330. Stats(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_StatsClient, error)
  331. SetSpeed(ctx context.Context, in *Speed, opts ...grpc.CallOption) (*None, error)
  332. }
  333. type snakeSimulatorClient struct {
  334. cc *grpc.ClientConn
  335. }
  336. func NewSnakeSimulatorClient(cc *grpc.ClientConn) SnakeSimulatorClient {
  337. return &snakeSimulatorClient{cc}
  338. }
  339. func (c *snakeSimulatorClient) Snake(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_SnakeClient, error) {
  340. stream, err := c.cc.NewStream(ctx, &_SnakeSimulator_serviceDesc.Streams[0], "/snakesimulator.SnakeSimulator/snake", opts...)
  341. if err != nil {
  342. return nil, err
  343. }
  344. x := &snakeSimulatorSnakeClient{stream}
  345. if err := x.ClientStream.SendMsg(in); err != nil {
  346. return nil, err
  347. }
  348. if err := x.ClientStream.CloseSend(); err != nil {
  349. return nil, err
  350. }
  351. return x, nil
  352. }
  353. type SnakeSimulator_SnakeClient interface {
  354. Recv() (*Snake, error)
  355. grpc.ClientStream
  356. }
  357. type snakeSimulatorSnakeClient struct {
  358. grpc.ClientStream
  359. }
  360. func (x *snakeSimulatorSnakeClient) Recv() (*Snake, error) {
  361. m := new(Snake)
  362. if err := x.ClientStream.RecvMsg(m); err != nil {
  363. return nil, err
  364. }
  365. return m, nil
  366. }
  367. func (c *snakeSimulatorClient) Field(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_FieldClient, error) {
  368. stream, err := c.cc.NewStream(ctx, &_SnakeSimulator_serviceDesc.Streams[1], "/snakesimulator.SnakeSimulator/field", opts...)
  369. if err != nil {
  370. return nil, err
  371. }
  372. x := &snakeSimulatorFieldClient{stream}
  373. if err := x.ClientStream.SendMsg(in); err != nil {
  374. return nil, err
  375. }
  376. if err := x.ClientStream.CloseSend(); err != nil {
  377. return nil, err
  378. }
  379. return x, nil
  380. }
  381. type SnakeSimulator_FieldClient interface {
  382. Recv() (*Field, error)
  383. grpc.ClientStream
  384. }
  385. type snakeSimulatorFieldClient struct {
  386. grpc.ClientStream
  387. }
  388. func (x *snakeSimulatorFieldClient) Recv() (*Field, error) {
  389. m := new(Field)
  390. if err := x.ClientStream.RecvMsg(m); err != nil {
  391. return nil, err
  392. }
  393. return m, nil
  394. }
  395. func (c *snakeSimulatorClient) Stats(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_StatsClient, error) {
  396. stream, err := c.cc.NewStream(ctx, &_SnakeSimulator_serviceDesc.Streams[2], "/snakesimulator.SnakeSimulator/stats", opts...)
  397. if err != nil {
  398. return nil, err
  399. }
  400. x := &snakeSimulatorStatsClient{stream}
  401. if err := x.ClientStream.SendMsg(in); err != nil {
  402. return nil, err
  403. }
  404. if err := x.ClientStream.CloseSend(); err != nil {
  405. return nil, err
  406. }
  407. return x, nil
  408. }
  409. type SnakeSimulator_StatsClient interface {
  410. Recv() (*Stats, error)
  411. grpc.ClientStream
  412. }
  413. type snakeSimulatorStatsClient struct {
  414. grpc.ClientStream
  415. }
  416. func (x *snakeSimulatorStatsClient) Recv() (*Stats, error) {
  417. m := new(Stats)
  418. if err := x.ClientStream.RecvMsg(m); err != nil {
  419. return nil, err
  420. }
  421. return m, nil
  422. }
  423. func (c *snakeSimulatorClient) SetSpeed(ctx context.Context, in *Speed, opts ...grpc.CallOption) (*None, error) {
  424. out := new(None)
  425. err := c.cc.Invoke(ctx, "/snakesimulator.SnakeSimulator/setSpeed", in, out, opts...)
  426. if err != nil {
  427. return nil, err
  428. }
  429. return out, nil
  430. }
  431. // SnakeSimulatorServer is the server API for SnakeSimulator service.
  432. type SnakeSimulatorServer interface {
  433. Snake(*None, SnakeSimulator_SnakeServer) error
  434. Field(*None, SnakeSimulator_FieldServer) error
  435. Stats(*None, SnakeSimulator_StatsServer) error
  436. SetSpeed(context.Context, *Speed) (*None, error)
  437. }
  438. // UnimplementedSnakeSimulatorServer can be embedded to have forward compatible implementations.
  439. type UnimplementedSnakeSimulatorServer struct {
  440. }
  441. func (*UnimplementedSnakeSimulatorServer) Snake(req *None, srv SnakeSimulator_SnakeServer) error {
  442. return status.Errorf(codes.Unimplemented, "method Snake not implemented")
  443. }
  444. func (*UnimplementedSnakeSimulatorServer) Field(req *None, srv SnakeSimulator_FieldServer) error {
  445. return status.Errorf(codes.Unimplemented, "method Field not implemented")
  446. }
  447. func (*UnimplementedSnakeSimulatorServer) Stats(req *None, srv SnakeSimulator_StatsServer) error {
  448. return status.Errorf(codes.Unimplemented, "method Stats not implemented")
  449. }
  450. func (*UnimplementedSnakeSimulatorServer) SetSpeed(ctx context.Context, req *Speed) (*None, error) {
  451. return nil, status.Errorf(codes.Unimplemented, "method SetSpeed not implemented")
  452. }
  453. func RegisterSnakeSimulatorServer(s *grpc.Server, srv SnakeSimulatorServer) {
  454. s.RegisterService(&_SnakeSimulator_serviceDesc, srv)
  455. }
  456. func _SnakeSimulator_Snake_Handler(srv interface{}, stream grpc.ServerStream) error {
  457. m := new(None)
  458. if err := stream.RecvMsg(m); err != nil {
  459. return err
  460. }
  461. return srv.(SnakeSimulatorServer).Snake(m, &snakeSimulatorSnakeServer{stream})
  462. }
  463. type SnakeSimulator_SnakeServer interface {
  464. Send(*Snake) error
  465. grpc.ServerStream
  466. }
  467. type snakeSimulatorSnakeServer struct {
  468. grpc.ServerStream
  469. }
  470. func (x *snakeSimulatorSnakeServer) Send(m *Snake) error {
  471. return x.ServerStream.SendMsg(m)
  472. }
  473. func _SnakeSimulator_Field_Handler(srv interface{}, stream grpc.ServerStream) error {
  474. m := new(None)
  475. if err := stream.RecvMsg(m); err != nil {
  476. return err
  477. }
  478. return srv.(SnakeSimulatorServer).Field(m, &snakeSimulatorFieldServer{stream})
  479. }
  480. type SnakeSimulator_FieldServer interface {
  481. Send(*Field) error
  482. grpc.ServerStream
  483. }
  484. type snakeSimulatorFieldServer struct {
  485. grpc.ServerStream
  486. }
  487. func (x *snakeSimulatorFieldServer) Send(m *Field) error {
  488. return x.ServerStream.SendMsg(m)
  489. }
  490. func _SnakeSimulator_Stats_Handler(srv interface{}, stream grpc.ServerStream) error {
  491. m := new(None)
  492. if err := stream.RecvMsg(m); err != nil {
  493. return err
  494. }
  495. return srv.(SnakeSimulatorServer).Stats(m, &snakeSimulatorStatsServer{stream})
  496. }
  497. type SnakeSimulator_StatsServer interface {
  498. Send(*Stats) error
  499. grpc.ServerStream
  500. }
  501. type snakeSimulatorStatsServer struct {
  502. grpc.ServerStream
  503. }
  504. func (x *snakeSimulatorStatsServer) Send(m *Stats) error {
  505. return x.ServerStream.SendMsg(m)
  506. }
  507. func _SnakeSimulator_SetSpeed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  508. in := new(Speed)
  509. if err := dec(in); err != nil {
  510. return nil, err
  511. }
  512. if interceptor == nil {
  513. return srv.(SnakeSimulatorServer).SetSpeed(ctx, in)
  514. }
  515. info := &grpc.UnaryServerInfo{
  516. Server: srv,
  517. FullMethod: "/snakesimulator.SnakeSimulator/SetSpeed",
  518. }
  519. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  520. return srv.(SnakeSimulatorServer).SetSpeed(ctx, req.(*Speed))
  521. }
  522. return interceptor(ctx, in, info, handler)
  523. }
  524. var _SnakeSimulator_serviceDesc = grpc.ServiceDesc{
  525. ServiceName: "snakesimulator.SnakeSimulator",
  526. HandlerType: (*SnakeSimulatorServer)(nil),
  527. Methods: []grpc.MethodDesc{
  528. {
  529. MethodName: "setSpeed",
  530. Handler: _SnakeSimulator_SetSpeed_Handler,
  531. },
  532. },
  533. Streams: []grpc.StreamDesc{
  534. {
  535. StreamName: "snake",
  536. Handler: _SnakeSimulator_Snake_Handler,
  537. ServerStreams: true,
  538. },
  539. {
  540. StreamName: "field",
  541. Handler: _SnakeSimulator_Field_Handler,
  542. ServerStreams: true,
  543. },
  544. {
  545. StreamName: "stats",
  546. Handler: _SnakeSimulator_Stats_Handler,
  547. ServerStreams: true,
  548. },
  549. },
  550. Metadata: "snakesimulator.proto",
  551. }