123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555 |
- // Code generated by protoc-gen-go. DO NOT EDIT.
- // source: snakesimulator.proto
- package snakesimulator
- import (
- context "context"
- fmt "fmt"
- proto "github.com/golang/protobuf/proto"
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
- math "math"
- )
- // Reference imports to suppress errors if they are not otherwise used.
- var _ = proto.Marshal
- var _ = fmt.Errorf
- var _ = math.Inf
- // This is a compile-time assertion to ensure that this generated file
- // is compatible with the proto package it is being compiled against.
- // A compilation error at this line likely means your copy of the
- // proto package needs to be updated.
- const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
- type Direction int32
- const (
- Direction_Unknown Direction = 0
- Direction_Up Direction = 1
- Direction_Down Direction = 2
- Direction_Left Direction = 3
- Direction_Right Direction = 4
- )
- var Direction_name = map[int32]string{
- 0: "Unknown",
- 1: "Up",
- 2: "Down",
- 3: "Left",
- 4: "Right",
- }
- var Direction_value = map[string]int32{
- "Unknown": 0,
- "Up": 1,
- "Down": 2,
- "Left": 3,
- "Right": 4,
- }
- func (x Direction) String() string {
- return proto.EnumName(Direction_name, int32(x))
- }
- func (Direction) EnumDescriptor() ([]byte, []int) {
- return fileDescriptor_b704e55df18a3970, []int{0}
- }
- type Point struct {
- X uint32 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"`
- Y uint32 `protobuf:"varint,2,opt,name=y,proto3" json:"y,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *Point) Reset() { *m = Point{} }
- func (m *Point) String() string { return proto.CompactTextString(m) }
- func (*Point) ProtoMessage() {}
- func (*Point) Descriptor() ([]byte, []int) {
- return fileDescriptor_b704e55df18a3970, []int{0}
- }
- func (m *Point) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Point.Unmarshal(m, b)
- }
- func (m *Point) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Point.Marshal(b, m, deterministic)
- }
- func (m *Point) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Point.Merge(m, src)
- }
- func (m *Point) XXX_Size() int {
- return xxx_messageInfo_Point.Size(m)
- }
- func (m *Point) XXX_DiscardUnknown() {
- xxx_messageInfo_Point.DiscardUnknown(m)
- }
- var xxx_messageInfo_Point proto.InternalMessageInfo
- func (m *Point) GetX() uint32 {
- if m != nil {
- return m.X
- }
- return 0
- }
- func (m *Point) GetY() uint32 {
- if m != nil {
- return m.Y
- }
- return 0
- }
- type Snake struct {
- Points []*Point `protobuf:"bytes,1,rep,name=points,proto3" json:"points,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *Snake) Reset() { *m = Snake{} }
- func (m *Snake) String() string { return proto.CompactTextString(m) }
- func (*Snake) ProtoMessage() {}
- func (*Snake) Descriptor() ([]byte, []int) {
- return fileDescriptor_b704e55df18a3970, []int{1}
- }
- func (m *Snake) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Snake.Unmarshal(m, b)
- }
- func (m *Snake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Snake.Marshal(b, m, deterministic)
- }
- func (m *Snake) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Snake.Merge(m, src)
- }
- func (m *Snake) XXX_Size() int {
- return xxx_messageInfo_Snake.Size(m)
- }
- func (m *Snake) XXX_DiscardUnknown() {
- xxx_messageInfo_Snake.DiscardUnknown(m)
- }
- var xxx_messageInfo_Snake proto.InternalMessageInfo
- func (m *Snake) GetPoints() []*Point {
- if m != nil {
- return m.Points
- }
- return nil
- }
- type Field struct {
- Width uint32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"`
- Height uint32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
- Food *Point `protobuf:"bytes,3,opt,name=food,proto3" json:"food,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *Field) Reset() { *m = Field{} }
- func (m *Field) String() string { return proto.CompactTextString(m) }
- func (*Field) ProtoMessage() {}
- func (*Field) Descriptor() ([]byte, []int) {
- return fileDescriptor_b704e55df18a3970, []int{2}
- }
- func (m *Field) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Field.Unmarshal(m, b)
- }
- func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Field.Marshal(b, m, deterministic)
- }
- func (m *Field) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Field.Merge(m, src)
- }
- func (m *Field) XXX_Size() int {
- return xxx_messageInfo_Field.Size(m)
- }
- func (m *Field) XXX_DiscardUnknown() {
- xxx_messageInfo_Field.DiscardUnknown(m)
- }
- var xxx_messageInfo_Field proto.InternalMessageInfo
- func (m *Field) GetWidth() uint32 {
- if m != nil {
- return m.Width
- }
- return 0
- }
- func (m *Field) GetHeight() uint32 {
- if m != nil {
- return m.Height
- }
- return 0
- }
- func (m *Field) GetFood() *Point {
- if m != nil {
- return m.Food
- }
- return nil
- }
- type Stats struct {
- Generation uint32 `protobuf:"varint,1,opt,name=generation,proto3" json:"generation,omitempty"`
- Individual uint32 `protobuf:"varint,2,opt,name=individual,proto3" json:"individual,omitempty"`
- Move uint32 `protobuf:"varint,3,opt,name=move,proto3" json:"move,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *Stats) Reset() { *m = Stats{} }
- func (m *Stats) String() string { return proto.CompactTextString(m) }
- func (*Stats) ProtoMessage() {}
- func (*Stats) Descriptor() ([]byte, []int) {
- return fileDescriptor_b704e55df18a3970, []int{3}
- }
- func (m *Stats) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_Stats.Unmarshal(m, b)
- }
- func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_Stats.Marshal(b, m, deterministic)
- }
- func (m *Stats) XXX_Merge(src proto.Message) {
- xxx_messageInfo_Stats.Merge(m, src)
- }
- func (m *Stats) XXX_Size() int {
- return xxx_messageInfo_Stats.Size(m)
- }
- func (m *Stats) XXX_DiscardUnknown() {
- xxx_messageInfo_Stats.DiscardUnknown(m)
- }
- var xxx_messageInfo_Stats proto.InternalMessageInfo
- func (m *Stats) GetGeneration() uint32 {
- if m != nil {
- return m.Generation
- }
- return 0
- }
- func (m *Stats) GetIndividual() uint32 {
- if m != nil {
- return m.Individual
- }
- return 0
- }
- func (m *Stats) GetMove() uint32 {
- if m != nil {
- return m.Move
- }
- return 0
- }
- type None struct {
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
- }
- func (m *None) Reset() { *m = None{} }
- func (m *None) String() string { return proto.CompactTextString(m) }
- func (*None) ProtoMessage() {}
- func (*None) Descriptor() ([]byte, []int) {
- return fileDescriptor_b704e55df18a3970, []int{4}
- }
- func (m *None) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_None.Unmarshal(m, b)
- }
- func (m *None) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_None.Marshal(b, m, deterministic)
- }
- func (m *None) XXX_Merge(src proto.Message) {
- xxx_messageInfo_None.Merge(m, src)
- }
- func (m *None) XXX_Size() int {
- return xxx_messageInfo_None.Size(m)
- }
- func (m *None) XXX_DiscardUnknown() {
- xxx_messageInfo_None.DiscardUnknown(m)
- }
- var xxx_messageInfo_None proto.InternalMessageInfo
- func init() {
- proto.RegisterEnum("snakesimulator.Direction", Direction_name, Direction_value)
- proto.RegisterType((*Point)(nil), "snakesimulator.Point")
- proto.RegisterType((*Snake)(nil), "snakesimulator.Snake")
- proto.RegisterType((*Field)(nil), "snakesimulator.Field")
- proto.RegisterType((*Stats)(nil), "snakesimulator.Stats")
- proto.RegisterType((*None)(nil), "snakesimulator.None")
- }
- func init() { proto.RegisterFile("snakesimulator.proto", fileDescriptor_b704e55df18a3970) }
- var fileDescriptor_b704e55df18a3970 = []byte{
- // 329 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x4b, 0xfb, 0x30,
- 0x18, 0xc6, 0x97, 0xad, 0xe9, 0xf7, 0xbb, 0x77, 0x6e, 0x94, 0x97, 0x29, 0xc5, 0x83, 0x8c, 0x78,
- 0x99, 0x82, 0x43, 0x26, 0x88, 0x37, 0x2f, 0xc3, 0x93, 0x88, 0x74, 0xec, 0xe4, 0xc5, 0x6a, 0xb3,
- 0x35, 0xac, 0x4b, 0x4a, 0x9b, 0xfd, 0xfa, 0xe7, 0xfc, 0xdb, 0x24, 0x69, 0x06, 0x73, 0x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 0xf5, 0x49, 0x1e, 0x10, 0xfc, 0x0f, 0xde, 0xc8, 0x28, 0x75, 0x73, 0x7a, 0xe6,
- 0x53, 0x1d, 0x34, 0xb0, 0x09, 0x34, 0x32, 0x75, 0x02, 0x6f, 0xf8, 0x45, 0xa0, 0x63, 0x17, 0x38,
- 0xde, 0x95, 0xc0, 0x07, 0xa0, 0xb6, 0x16, 0x76, 0x0f, 0xeb, 0x19, 0xe4, 0xf9, 0xaf, 0xd2, 0x36,
- 0xce, 0x6a, 0xb7, 0xc4, 0x24, 0xa7, 0xd5, 0x52, 0x8f, 0x4b, 0xda, 0x3f, 0xb0, 0x4b, 0x96, 0x76,
- 0x59, 0xc7, 0x32, 0x8d, 0xd9, 0x24, 0x3f, 0x7c, 0xfb, 0x78, 0xee, 0xbe, 0x03, 0x00, 0x00, 0xff,
- 0xff, 0x74, 0x50, 0xa2, 0x2d, 0x54, 0x02, 0x00, 0x00,
- }
- // Reference imports to suppress errors if they are not otherwise used.
- var _ context.Context
- var _ grpc.ClientConn
- // This is a compile-time assertion to ensure that this generated file
- // is compatible with the grpc package it is being compiled against.
- const _ = grpc.SupportPackageIsVersion4
- // SnakeSimulatorClient is the client API for SnakeSimulator service.
- //
- // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
- type SnakeSimulatorClient interface {
- Snake(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_SnakeClient, error)
- Field(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_FieldClient, error)
- Stats(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_StatsClient, error)
- }
- type snakeSimulatorClient struct {
- cc *grpc.ClientConn
- }
- func NewSnakeSimulatorClient(cc *grpc.ClientConn) SnakeSimulatorClient {
- return &snakeSimulatorClient{cc}
- }
- func (c *snakeSimulatorClient) Snake(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_SnakeClient, error) {
- stream, err := c.cc.NewStream(ctx, &_SnakeSimulator_serviceDesc.Streams[0], "/snakesimulator.SnakeSimulator/snake", opts...)
- if err != nil {
- return nil, err
- }
- x := &snakeSimulatorSnakeClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
- }
- type SnakeSimulator_SnakeClient interface {
- Recv() (*Snake, error)
- grpc.ClientStream
- }
- type snakeSimulatorSnakeClient struct {
- grpc.ClientStream
- }
- func (x *snakeSimulatorSnakeClient) Recv() (*Snake, error) {
- m := new(Snake)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
- }
- func (c *snakeSimulatorClient) Field(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_FieldClient, error) {
- stream, err := c.cc.NewStream(ctx, &_SnakeSimulator_serviceDesc.Streams[1], "/snakesimulator.SnakeSimulator/field", opts...)
- if err != nil {
- return nil, err
- }
- x := &snakeSimulatorFieldClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
- }
- type SnakeSimulator_FieldClient interface {
- Recv() (*Field, error)
- grpc.ClientStream
- }
- type snakeSimulatorFieldClient struct {
- grpc.ClientStream
- }
- func (x *snakeSimulatorFieldClient) Recv() (*Field, error) {
- m := new(Field)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
- }
- func (c *snakeSimulatorClient) Stats(ctx context.Context, in *None, opts ...grpc.CallOption) (SnakeSimulator_StatsClient, error) {
- stream, err := c.cc.NewStream(ctx, &_SnakeSimulator_serviceDesc.Streams[2], "/snakesimulator.SnakeSimulator/stats", opts...)
- if err != nil {
- return nil, err
- }
- x := &snakeSimulatorStatsClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
- }
- type SnakeSimulator_StatsClient interface {
- Recv() (*Stats, error)
- grpc.ClientStream
- }
- type snakeSimulatorStatsClient struct {
- grpc.ClientStream
- }
- func (x *snakeSimulatorStatsClient) Recv() (*Stats, error) {
- m := new(Stats)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
- }
- // SnakeSimulatorServer is the server API for SnakeSimulator service.
- type SnakeSimulatorServer interface {
- Snake(*None, SnakeSimulator_SnakeServer) error
- Field(*None, SnakeSimulator_FieldServer) error
- Stats(*None, SnakeSimulator_StatsServer) error
- }
- // UnimplementedSnakeSimulatorServer can be embedded to have forward compatible implementations.
- type UnimplementedSnakeSimulatorServer struct {
- }
- func (*UnimplementedSnakeSimulatorServer) Snake(req *None, srv SnakeSimulator_SnakeServer) error {
- return status.Errorf(codes.Unimplemented, "method Snake not implemented")
- }
- func (*UnimplementedSnakeSimulatorServer) Field(req *None, srv SnakeSimulator_FieldServer) error {
- return status.Errorf(codes.Unimplemented, "method Field not implemented")
- }
- func (*UnimplementedSnakeSimulatorServer) Stats(req *None, srv SnakeSimulator_StatsServer) error {
- return status.Errorf(codes.Unimplemented, "method Stats not implemented")
- }
- func RegisterSnakeSimulatorServer(s *grpc.Server, srv SnakeSimulatorServer) {
- s.RegisterService(&_SnakeSimulator_serviceDesc, srv)
- }
- func _SnakeSimulator_Snake_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(None)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(SnakeSimulatorServer).Snake(m, &snakeSimulatorSnakeServer{stream})
- }
- type SnakeSimulator_SnakeServer interface {
- Send(*Snake) error
- grpc.ServerStream
- }
- type snakeSimulatorSnakeServer struct {
- grpc.ServerStream
- }
- func (x *snakeSimulatorSnakeServer) Send(m *Snake) error {
- return x.ServerStream.SendMsg(m)
- }
- func _SnakeSimulator_Field_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(None)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(SnakeSimulatorServer).Field(m, &snakeSimulatorFieldServer{stream})
- }
- type SnakeSimulator_FieldServer interface {
- Send(*Field) error
- grpc.ServerStream
- }
- type snakeSimulatorFieldServer struct {
- grpc.ServerStream
- }
- func (x *snakeSimulatorFieldServer) Send(m *Field) error {
- return x.ServerStream.SendMsg(m)
- }
- func _SnakeSimulator_Stats_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(None)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(SnakeSimulatorServer).Stats(m, &snakeSimulatorStatsServer{stream})
- }
- type SnakeSimulator_StatsServer interface {
- Send(*Stats) error
- grpc.ServerStream
- }
- type snakeSimulatorStatsServer struct {
- grpc.ServerStream
- }
- func (x *snakeSimulatorStatsServer) Send(m *Stats) error {
- return x.ServerStream.SendMsg(m)
- }
- var _SnakeSimulator_serviceDesc = grpc.ServiceDesc{
- ServiceName: "snakesimulator.SnakeSimulator",
- HandlerType: (*SnakeSimulatorServer)(nil),
- Methods: []grpc.MethodDesc{},
- Streams: []grpc.StreamDesc{
- {
- StreamName: "snake",
- Handler: _SnakeSimulator_Snake_Handler,
- ServerStreams: true,
- },
- {
- StreamName: "field",
- Handler: _SnakeSimulator_Field_Handler,
- ServerStreams: true,
- },
- {
- StreamName: "stats",
- Handler: _SnakeSimulator_Stats_Handler,
- ServerStreams: true,
- },
- },
- Metadata: "snakesimulator.proto",
- }
|