snakesimulator.pb.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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 None struct {
  174. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  175. XXX_unrecognized []byte `json:"-"`
  176. XXX_sizecache int32 `json:"-"`
  177. }
  178. func (m *None) Reset() { *m = None{} }
  179. func (m *None) String() string { return proto.CompactTextString(m) }
  180. func (*None) ProtoMessage() {}
  181. func (*None) Descriptor() ([]byte, []int) {
  182. return fileDescriptor_b704e55df18a3970, []int{3}
  183. }
  184. func (m *None) XXX_Unmarshal(b []byte) error {
  185. return xxx_messageInfo_None.Unmarshal(m, b)
  186. }
  187. func (m *None) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  188. return xxx_messageInfo_None.Marshal(b, m, deterministic)
  189. }
  190. func (m *None) XXX_Merge(src proto.Message) {
  191. xxx_messageInfo_None.Merge(m, src)
  192. }
  193. func (m *None) XXX_Size() int {
  194. return xxx_messageInfo_None.Size(m)
  195. }
  196. func (m *None) XXX_DiscardUnknown() {
  197. xxx_messageInfo_None.DiscardUnknown(m)
  198. }
  199. var xxx_messageInfo_None proto.InternalMessageInfo
  200. func init() {
  201. proto.RegisterEnum("snakesimulator.Direction", Direction_name, Direction_value)
  202. proto.RegisterType((*Point)(nil), "snakesimulator.Point")
  203. proto.RegisterType((*Snake)(nil), "snakesimulator.Snake")
  204. proto.RegisterType((*Field)(nil), "snakesimulator.Field")
  205. proto.RegisterType((*None)(nil), "snakesimulator.None")
  206. }
  207. func init() { proto.RegisterFile("snakesimulator.proto", fileDescriptor_b704e55df18a3970) }
  208. var fileDescriptor_b704e55df18a3970 = []byte{
  209. // 273 bytes of a gzipped FileDescriptorProto
  210. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0xc1, 0x4b, 0xc3, 0x30,
  211. 0x14, 0x87, 0x97, 0xb6, 0xa9, 0xee, 0x4d, 0x47, 0x79, 0x54, 0x29, 0x9e, 0x4a, 0xbc, 0x4c, 0xc1,
  212. 0x21, 0x13, 0xc4, 0x9b, 0x97, 0xe1, 0x49, 0x44, 0x3a, 0x76, 0x77, 0xda, 0xd4, 0x86, 0xcd, 0xa4,
  213. 0xb4, 0x91, 0x6d, 0x77, 0xff, 0x70, 0x79, 0x69, 0x3d, 0x38, 0x11, 0x76, 0xcb, 0xef, 0xf1, 0xbe,
  214. 0x7c, 0xef, 0x25, 0x10, 0x37, 0x7a, 0xb1, 0x94, 0x8d, 0xfa, 0xf8, 0x5c, 0x2d, 0xac, 0xa9, 0xc7,
  215. 0x55, 0x6d, 0xac, 0xc1, 0xe1, 0xef, 0xaa, 0x38, 0x07, 0xfe, 0x6c, 0x94, 0xb6, 0x78, 0x04, 0x6c,
  216. 0x93, 0xb0, 0x94, 0x8d, 0x8e, 0x33, 0xb6, 0xa1, 0xb4, 0x4d, 0xbc, 0x36, 0x6d, 0xc5, 0x2d, 0xf0,
  217. 0x19, 0x61, 0x78, 0x05, 0x61, 0x45, 0xdd, 0x4d, 0xc2, 0x52, 0x7f, 0x34, 0x98, 0x9c, 0x8c, 0x77,
  218. 0x24, 0xee, 0xae, 0xac, 0x6b, 0x12, 0x2f, 0xc0, 0x1f, 0x94, 0x5c, 0xe5, 0x18, 0x03, 0x5f, 0xab,
  219. 0xdc, 0x96, 0x9d, 0xa0, 0x0d, 0x78, 0x0a, 0x61, 0x29, 0xd5, 0x7b, 0x69, 0x3b, 0x53, 0x97, 0xf0,
  220. 0x02, 0x82, 0xc2, 0x98, 0x3c, 0xf1, 0x53, 0xf6, 0xbf, 0xc3, 0xb5, 0x88, 0x10, 0x82, 0x27, 0xa3,
  221. 0xe5, 0xe5, 0x3d, 0xf4, 0xa7, 0xaa, 0x96, 0x6f, 0x56, 0x19, 0x8d, 0x03, 0x38, 0x98, 0xeb, 0xa5,
  222. 0x36, 0x6b, 0x1d, 0xf5, 0x30, 0x04, 0x6f, 0x5e, 0x45, 0x0c, 0x0f, 0x21, 0x98, 0x52, 0xc5, 0xa3,
  223. 0xd3, 0xa3, 0x2c, 0x6c, 0xe4, 0x63, 0x1f, 0x78, 0x46, 0xc6, 0x28, 0x98, 0x7c, 0x31, 0x18, 0xba,
  224. 0x1d, 0x67, 0x3f, 0x1e, 0xbc, 0x03, 0xee, 0xcc, 0x18, 0xef, 0x4e, 0x40, 0xca, 0xb3, 0x3f, 0x73,
  225. 0x39, 0x5c, 0xf4, 0xae, 0x19, 0x91, 0x45, 0xbb, 0xf7, 0x7e, 0xa4, 0x7b, 0x24, 0x22, 0x5f, 0x43,
  226. 0xf7, 0x4b, 0x37, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x15, 0x7b, 0x53, 0xb6, 0xbd, 0x01, 0x00,
  227. 0x00,
  228. }
  229. // Reference imports to suppress errors if they are not otherwise used.
  230. var _ context.Context
  231. var _ grpc.ClientConn
  232. // This is a compile-time assertion to ensure that this generated file
  233. // is compatible with the grpc package it is being compiled against.
  234. const _ = grpc.SupportPackageIsVersion4
  235. // SnakeSimulatorClient is the client API for SnakeSimulator service.
  236. //
  237. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  238. type SnakeSimulatorClient interface {
  239. Snake(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_SnakeClient, error)
  240. Field(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_FieldClient, error)
  241. }
  242. type snakeSimulatorClient struct {
  243. cc *grpc.ClientConn
  244. }
  245. func NewSnakeSimulatorClient(cc *grpc.ClientConn) SnakeSimulatorClient {
  246. return &snakeSimulatorClient{cc}
  247. }
  248. func (c *snakeSimulatorClient) Snake(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_SnakeClient, error) {
  249. stream, err := c.cc.NewStream(ctx, &_SnakeSimulator_serviceDesc.Streams[0], "/snakesimulator.SnakeSimulator/snake", opts...)
  250. if err != nil {
  251. return nil, err
  252. }
  253. x := &snakeSimulatorSnakeClient{stream}
  254. if err := x.ClientStream.SendMsg(in); err != nil {
  255. return nil, err
  256. }
  257. if err := x.ClientStream.CloseSend(); err != nil {
  258. return nil, err
  259. }
  260. return x, nil
  261. }
  262. type SnakeSimulator_SnakeClient interface {
  263. Recv() (*Snake, error)
  264. grpc.ClientStream
  265. }
  266. type snakeSimulatorSnakeClient struct {
  267. grpc.ClientStream
  268. }
  269. func (x *snakeSimulatorSnakeClient) Recv() (*Snake, error) {
  270. m := new(Snake)
  271. if err := x.ClientStream.RecvMsg(m); err != nil {
  272. return nil, err
  273. }
  274. return m, nil
  275. }
  276. func (c *snakeSimulatorClient) Field(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_FieldClient, error) {
  277. stream, err := c.cc.NewStream(ctx, &_SnakeSimulator_serviceDesc.Streams[1], "/snakesimulator.SnakeSimulator/field", opts...)
  278. if err != nil {
  279. return nil, err
  280. }
  281. x := &snakeSimulatorFieldClient{stream}
  282. if err := x.ClientStream.SendMsg(in); err != nil {
  283. return nil, err
  284. }
  285. if err := x.ClientStream.CloseSend(); err != nil {
  286. return nil, err
  287. }
  288. return x, nil
  289. }
  290. type SnakeSimulator_FieldClient interface {
  291. Recv() (*Field, error)
  292. grpc.ClientStream
  293. }
  294. type snakeSimulatorFieldClient struct {
  295. grpc.ClientStream
  296. }
  297. func (x *snakeSimulatorFieldClient) Recv() (*Field, error) {
  298. m := new(Field)
  299. if err := x.ClientStream.RecvMsg(m); err != nil {
  300. return nil, err
  301. }
  302. return m, nil
  303. }
  304. // SnakeSimulatorServer is the server API for SnakeSimulator service.
  305. type SnakeSimulatorServer interface {
  306. Snake(*None, SnakeSimulator_SnakeServer) error
  307. Field(*None, SnakeSimulator_FieldServer) error
  308. }
  309. // UnimplementedSnakeSimulatorServer can be embedded to have forward compatible implementations.
  310. type UnimplementedSnakeSimulatorServer struct {
  311. }
  312. func (*UnimplementedSnakeSimulatorServer) Snake(req *None, srv SnakeSimulator_SnakeServer) error {
  313. return status.Errorf(codes.Unimplemented, "method Snake not implemented")
  314. }
  315. func (*UnimplementedSnakeSimulatorServer) Field(req *None, srv SnakeSimulator_FieldServer) error {
  316. return status.Errorf(codes.Unimplemented, "method Field not implemented")
  317. }
  318. func RegisterSnakeSimulatorServer(s *grpc.Server, srv SnakeSimulatorServer) {
  319. s.RegisterService(&_SnakeSimulator_serviceDesc, srv)
  320. }
  321. func _SnakeSimulator_Snake_Handler(srv interface{}, stream grpc.ServerStream) error {
  322. m := new(None)
  323. if err := stream.RecvMsg(m); err != nil {
  324. return err
  325. }
  326. return srv.(SnakeSimulatorServer).Snake(m, &snakeSimulatorSnakeServer{stream})
  327. }
  328. type SnakeSimulator_SnakeServer interface {
  329. Send(*Snake) error
  330. grpc.ServerStream
  331. }
  332. type snakeSimulatorSnakeServer struct {
  333. grpc.ServerStream
  334. }
  335. func (x *snakeSimulatorSnakeServer) Send(m *Snake) error {
  336. return x.ServerStream.SendMsg(m)
  337. }
  338. func _SnakeSimulator_Field_Handler(srv interface{}, stream grpc.ServerStream) error {
  339. m := new(None)
  340. if err := stream.RecvMsg(m); err != nil {
  341. return err
  342. }
  343. return srv.(SnakeSimulatorServer).Field(m, &snakeSimulatorFieldServer{stream})
  344. }
  345. type SnakeSimulator_FieldServer interface {
  346. Send(*Field) error
  347. grpc.ServerStream
  348. }
  349. type snakeSimulatorFieldServer struct {
  350. grpc.ServerStream
  351. }
  352. func (x *snakeSimulatorFieldServer) Send(m *Field) error {
  353. return x.ServerStream.SendMsg(m)
  354. }
  355. var _SnakeSimulator_serviceDesc = grpc.ServiceDesc{
  356. ServiceName: "snakesimulator.SnakeSimulator",
  357. HandlerType: (*SnakeSimulatorServer)(nil),
  358. Methods: []grpc.MethodDesc{},
  359. Streams: []grpc.StreamDesc{
  360. {
  361. StreamName: "snake",
  362. Handler: _SnakeSimulator_Snake_Handler,
  363. ServerStreams: true,
  364. },
  365. {
  366. StreamName: "field",
  367. Handler: _SnakeSimulator_Field_Handler,
  368. ServerStreams: true,
  369. },
  370. },
  371. Metadata: "snakesimulator.proto",
  372. }