remotecontrol.pb.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: remotecontrol.proto
  3. package remotecontrol
  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 NetworkState_State int32
  23. const (
  24. NetworkState_None NetworkState_State = 0
  25. NetworkState_Idle NetworkState_State = 1
  26. NetworkState_Learning NetworkState_State = 2
  27. NetworkState_Validation NetworkState_State = 3
  28. NetworkState_Predict NetworkState_State = 4
  29. )
  30. var NetworkState_State_name = map[int32]string{
  31. 0: "None",
  32. 1: "Idle",
  33. 2: "Learning",
  34. 3: "Validation",
  35. 4: "Predict",
  36. }
  37. var NetworkState_State_value = map[string]int32{
  38. "None": 0,
  39. "Idle": 1,
  40. "Learning": 2,
  41. "Validation": 3,
  42. "Predict": 4,
  43. }
  44. func (x NetworkState_State) String() string {
  45. return proto.EnumName(NetworkState_State_name, int32(x))
  46. }
  47. func (NetworkState_State) EnumDescriptor() ([]byte, []int) {
  48. return fileDescriptor_9e7470c0107e56c6, []int{0, 0}
  49. }
  50. type LayerMatrix_ContentType int32
  51. const (
  52. LayerMatrix_Activations LayerMatrix_ContentType = 0
  53. LayerMatrix_Weights LayerMatrix_ContentType = 1
  54. LayerMatrix_Biases LayerMatrix_ContentType = 2
  55. )
  56. var LayerMatrix_ContentType_name = map[int32]string{
  57. 0: "Activations",
  58. 1: "Weights",
  59. 2: "Biases",
  60. }
  61. var LayerMatrix_ContentType_value = map[string]int32{
  62. "Activations": 0,
  63. "Weights": 1,
  64. "Biases": 2,
  65. }
  66. func (x LayerMatrix_ContentType) String() string {
  67. return proto.EnumName(LayerMatrix_ContentType_name, int32(x))
  68. }
  69. func (LayerMatrix_ContentType) EnumDescriptor() ([]byte, []int) {
  70. return fileDescriptor_9e7470c0107e56c6, []int{2, 0}
  71. }
  72. type NetworkState struct {
  73. State NetworkState_State `protobuf:"varint,1,opt,name=state,proto3,enum=remotecontrol.NetworkState_State" json:"state,omitempty"`
  74. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  75. XXX_unrecognized []byte `json:"-"`
  76. XXX_sizecache int32 `json:"-"`
  77. }
  78. func (m *NetworkState) Reset() { *m = NetworkState{} }
  79. func (m *NetworkState) String() string { return proto.CompactTextString(m) }
  80. func (*NetworkState) ProtoMessage() {}
  81. func (*NetworkState) Descriptor() ([]byte, []int) {
  82. return fileDescriptor_9e7470c0107e56c6, []int{0}
  83. }
  84. func (m *NetworkState) XXX_Unmarshal(b []byte) error {
  85. return xxx_messageInfo_NetworkState.Unmarshal(m, b)
  86. }
  87. func (m *NetworkState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  88. return xxx_messageInfo_NetworkState.Marshal(b, m, deterministic)
  89. }
  90. func (m *NetworkState) XXX_Merge(src proto.Message) {
  91. xxx_messageInfo_NetworkState.Merge(m, src)
  92. }
  93. func (m *NetworkState) XXX_Size() int {
  94. return xxx_messageInfo_NetworkState.Size(m)
  95. }
  96. func (m *NetworkState) XXX_DiscardUnknown() {
  97. xxx_messageInfo_NetworkState.DiscardUnknown(m)
  98. }
  99. var xxx_messageInfo_NetworkState proto.InternalMessageInfo
  100. func (m *NetworkState) GetState() NetworkState_State {
  101. if m != nil {
  102. return m.State
  103. }
  104. return NetworkState_None
  105. }
  106. type Matrix struct {
  107. Matrix []byte `protobuf:"bytes,1,opt,name=matrix,proto3" json:"matrix,omitempty"`
  108. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  109. XXX_unrecognized []byte `json:"-"`
  110. XXX_sizecache int32 `json:"-"`
  111. }
  112. func (m *Matrix) Reset() { *m = Matrix{} }
  113. func (m *Matrix) String() string { return proto.CompactTextString(m) }
  114. func (*Matrix) ProtoMessage() {}
  115. func (*Matrix) Descriptor() ([]byte, []int) {
  116. return fileDescriptor_9e7470c0107e56c6, []int{1}
  117. }
  118. func (m *Matrix) XXX_Unmarshal(b []byte) error {
  119. return xxx_messageInfo_Matrix.Unmarshal(m, b)
  120. }
  121. func (m *Matrix) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  122. return xxx_messageInfo_Matrix.Marshal(b, m, deterministic)
  123. }
  124. func (m *Matrix) XXX_Merge(src proto.Message) {
  125. xxx_messageInfo_Matrix.Merge(m, src)
  126. }
  127. func (m *Matrix) XXX_Size() int {
  128. return xxx_messageInfo_Matrix.Size(m)
  129. }
  130. func (m *Matrix) XXX_DiscardUnknown() {
  131. xxx_messageInfo_Matrix.DiscardUnknown(m)
  132. }
  133. var xxx_messageInfo_Matrix proto.InternalMessageInfo
  134. func (m *Matrix) GetMatrix() []byte {
  135. if m != nil {
  136. return m.Matrix
  137. }
  138. return nil
  139. }
  140. type LayerMatrix struct {
  141. ContentType LayerMatrix_ContentType `protobuf:"varint,1,opt,name=contentType,proto3,enum=remotecontrol.LayerMatrix_ContentType" json:"contentType,omitempty"`
  142. Layer int32 `protobuf:"zigzag32,2,opt,name=layer,proto3" json:"layer,omitempty"`
  143. Matrix *Matrix `protobuf:"bytes,3,opt,name=matrix,proto3" json:"matrix,omitempty"`
  144. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  145. XXX_unrecognized []byte `json:"-"`
  146. XXX_sizecache int32 `json:"-"`
  147. }
  148. func (m *LayerMatrix) Reset() { *m = LayerMatrix{} }
  149. func (m *LayerMatrix) String() string { return proto.CompactTextString(m) }
  150. func (*LayerMatrix) ProtoMessage() {}
  151. func (*LayerMatrix) Descriptor() ([]byte, []int) {
  152. return fileDescriptor_9e7470c0107e56c6, []int{2}
  153. }
  154. func (m *LayerMatrix) XXX_Unmarshal(b []byte) error {
  155. return xxx_messageInfo_LayerMatrix.Unmarshal(m, b)
  156. }
  157. func (m *LayerMatrix) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  158. return xxx_messageInfo_LayerMatrix.Marshal(b, m, deterministic)
  159. }
  160. func (m *LayerMatrix) XXX_Merge(src proto.Message) {
  161. xxx_messageInfo_LayerMatrix.Merge(m, src)
  162. }
  163. func (m *LayerMatrix) XXX_Size() int {
  164. return xxx_messageInfo_LayerMatrix.Size(m)
  165. }
  166. func (m *LayerMatrix) XXX_DiscardUnknown() {
  167. xxx_messageInfo_LayerMatrix.DiscardUnknown(m)
  168. }
  169. var xxx_messageInfo_LayerMatrix proto.InternalMessageInfo
  170. func (m *LayerMatrix) GetContentType() LayerMatrix_ContentType {
  171. if m != nil {
  172. return m.ContentType
  173. }
  174. return LayerMatrix_Activations
  175. }
  176. func (m *LayerMatrix) GetLayer() int32 {
  177. if m != nil {
  178. return m.Layer
  179. }
  180. return 0
  181. }
  182. func (m *LayerMatrix) GetMatrix() *Matrix {
  183. if m != nil {
  184. return m.Matrix
  185. }
  186. return nil
  187. }
  188. type Configuration struct {
  189. Sizes []int32 `protobuf:"zigzag32,1,rep,packed,name=sizes,proto3" json:"sizes,omitempty"`
  190. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  191. XXX_unrecognized []byte `json:"-"`
  192. XXX_sizecache int32 `json:"-"`
  193. }
  194. func (m *Configuration) Reset() { *m = Configuration{} }
  195. func (m *Configuration) String() string { return proto.CompactTextString(m) }
  196. func (*Configuration) ProtoMessage() {}
  197. func (*Configuration) Descriptor() ([]byte, []int) {
  198. return fileDescriptor_9e7470c0107e56c6, []int{3}
  199. }
  200. func (m *Configuration) XXX_Unmarshal(b []byte) error {
  201. return xxx_messageInfo_Configuration.Unmarshal(m, b)
  202. }
  203. func (m *Configuration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  204. return xxx_messageInfo_Configuration.Marshal(b, m, deterministic)
  205. }
  206. func (m *Configuration) XXX_Merge(src proto.Message) {
  207. xxx_messageInfo_Configuration.Merge(m, src)
  208. }
  209. func (m *Configuration) XXX_Size() int {
  210. return xxx_messageInfo_Configuration.Size(m)
  211. }
  212. func (m *Configuration) XXX_DiscardUnknown() {
  213. xxx_messageInfo_Configuration.DiscardUnknown(m)
  214. }
  215. var xxx_messageInfo_Configuration proto.InternalMessageInfo
  216. func (m *Configuration) GetSizes() []int32 {
  217. if m != nil {
  218. return m.Sizes
  219. }
  220. return nil
  221. }
  222. type None struct {
  223. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  224. XXX_unrecognized []byte `json:"-"`
  225. XXX_sizecache int32 `json:"-"`
  226. }
  227. func (m *None) Reset() { *m = None{} }
  228. func (m *None) String() string { return proto.CompactTextString(m) }
  229. func (*None) ProtoMessage() {}
  230. func (*None) Descriptor() ([]byte, []int) {
  231. return fileDescriptor_9e7470c0107e56c6, []int{4}
  232. }
  233. func (m *None) XXX_Unmarshal(b []byte) error {
  234. return xxx_messageInfo_None.Unmarshal(m, b)
  235. }
  236. func (m *None) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  237. return xxx_messageInfo_None.Marshal(b, m, deterministic)
  238. }
  239. func (m *None) XXX_Merge(src proto.Message) {
  240. xxx_messageInfo_None.Merge(m, src)
  241. }
  242. func (m *None) XXX_Size() int {
  243. return xxx_messageInfo_None.Size(m)
  244. }
  245. func (m *None) XXX_DiscardUnknown() {
  246. xxx_messageInfo_None.DiscardUnknown(m)
  247. }
  248. var xxx_messageInfo_None proto.InternalMessageInfo
  249. func init() {
  250. proto.RegisterEnum("remotecontrol.NetworkState_State", NetworkState_State_name, NetworkState_State_value)
  251. proto.RegisterEnum("remotecontrol.LayerMatrix_ContentType", LayerMatrix_ContentType_name, LayerMatrix_ContentType_value)
  252. proto.RegisterType((*NetworkState)(nil), "remotecontrol.NetworkState")
  253. proto.RegisterType((*Matrix)(nil), "remotecontrol.Matrix")
  254. proto.RegisterType((*LayerMatrix)(nil), "remotecontrol.LayerMatrix")
  255. proto.RegisterType((*Configuration)(nil), "remotecontrol.Configuration")
  256. proto.RegisterType((*None)(nil), "remotecontrol.None")
  257. }
  258. func init() { proto.RegisterFile("remotecontrol.proto", fileDescriptor_9e7470c0107e56c6) }
  259. var fileDescriptor_9e7470c0107e56c6 = []byte{
  260. // 394 bytes of a gzipped FileDescriptorProto
  261. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0x4f, 0x6f, 0xda, 0x30,
  262. 0x18, 0xc6, 0xe3, 0x00, 0x19, 0x7a, 0x03, 0xcc, 0x33, 0xdb, 0x84, 0xd8, 0x0e, 0x99, 0xa5, 0x4d,
  263. 0x5c, 0x16, 0x4d, 0xec, 0xc0, 0x69, 0x93, 0x06, 0xd2, 0xfe, 0x48, 0x0c, 0x4d, 0xd9, 0xb4, 0x9e,
  264. 0x53, 0x70, 0x53, 0xab, 0xc1, 0x46, 0x8e, 0xfb, 0x87, 0x7e, 0x89, 0x7e, 0xba, 0x5e, 0xfa, 0x69,
  265. 0x2a, 0x3b, 0x40, 0x93, 0x88, 0xf6, 0xc0, 0x05, 0xbd, 0xaf, 0xf5, 0x3c, 0x8f, 0x7f, 0xef, 0x8b,
  266. 0x03, 0x5d, 0xc5, 0x96, 0x52, 0xb3, 0xb9, 0x14, 0x5a, 0xc9, 0x34, 0x5c, 0x29, 0xa9, 0x25, 0x69,
  267. 0x97, 0x0e, 0xe9, 0x0d, 0x82, 0xd6, 0x8c, 0xe9, 0x4b, 0xa9, 0xce, 0xfe, 0xea, 0x58, 0x33, 0x32,
  268. 0x82, 0x46, 0x66, 0x8a, 0x1e, 0x0a, 0xd0, 0xa0, 0x33, 0x7c, 0x17, 0x96, 0x43, 0x8a, 0xda, 0xd0,
  269. 0xfe, 0x46, 0xb9, 0x9e, 0x7e, 0x87, 0x46, 0x9e, 0xd0, 0x84, 0xfa, 0x4c, 0x0a, 0x86, 0x1d, 0x53,
  270. 0xfd, 0x5a, 0xa4, 0x0c, 0x23, 0xd2, 0x82, 0xe6, 0x94, 0xc5, 0x4a, 0x70, 0x91, 0x60, 0x97, 0x74,
  271. 0x00, 0xfe, 0xc7, 0x29, 0x5f, 0xc4, 0x9a, 0x4b, 0x81, 0x6b, 0xc4, 0x87, 0x67, 0x7f, 0x14, 0x5b,
  272. 0xf0, 0xb9, 0xc6, 0x75, 0x1a, 0x80, 0xf7, 0x3b, 0xd6, 0x8a, 0x5f, 0x91, 0xd7, 0xe0, 0x2d, 0x6d,
  273. 0x65, 0x59, 0x5a, 0xd1, 0xa6, 0xa3, 0xb7, 0x08, 0xfc, 0x69, 0xbc, 0x66, 0x6a, 0xa3, 0xfb, 0x09,
  274. 0xbe, 0xc1, 0x63, 0x42, 0xff, 0x5b, 0xaf, 0xb6, 0xe0, 0x1f, 0x2a, 0xe0, 0x05, 0x43, 0x38, 0x79,
  275. 0x50, 0x47, 0x45, 0x2b, 0x79, 0x09, 0x8d, 0xd4, 0xe8, 0x7a, 0x6e, 0x80, 0x06, 0x2f, 0xa2, 0xbc,
  276. 0x21, 0x1f, 0x77, 0x1c, 0xb5, 0x00, 0x0d, 0xfc, 0xe1, 0xab, 0x4a, 0x74, 0x9e, 0xba, 0xc3, 0x1b,
  277. 0x81, 0x5f, 0xb8, 0x80, 0x3c, 0x07, 0xff, 0xdb, 0x5c, 0xf3, 0x0b, 0x3b, 0x6c, 0x86, 0x1d, 0x33,
  278. 0xed, 0x11, 0xe3, 0xc9, 0xa9, 0xce, 0x30, 0x22, 0x00, 0xde, 0x98, 0xc7, 0x19, 0xcb, 0xb0, 0x4b,
  279. 0xdf, 0x43, 0x7b, 0x22, 0xc5, 0x09, 0x4f, 0xce, 0x95, 0x15, 0x1b, 0x9c, 0x8c, 0x5f, 0xb3, 0xac,
  280. 0x87, 0x82, 0x9a, 0xc1, 0xb1, 0x0d, 0xf5, 0xf2, 0xfd, 0x0e, 0xef, 0x5c, 0x68, 0x47, 0x16, 0x64,
  281. 0x92, 0x83, 0x90, 0x1f, 0x80, 0x13, 0xa6, 0xcb, 0x19, 0xdd, 0xea, 0x1f, 0x28, 0x05, 0xeb, 0xbf,
  282. 0xad, 0x1c, 0x96, 0x2c, 0xd4, 0x21, 0xe3, 0x12, 0xf3, 0xfe, 0x8c, 0xfe, 0xe3, 0x0b, 0xa6, 0xce,
  283. 0x27, 0x44, 0xbe, 0x6c, 0x27, 0x3b, 0xcc, 0xfe, 0x75, 0xb7, 0xa5, 0x43, 0xaf, 0xdf, 0x3c, 0xc7,
  284. 0xbd, 0xee, 0x37, 0x4f, 0x3c, 0x6b, 0x63, 0x3f, 0xf6, 0xec, 0xd7, 0xf2, 0xf9, 0x3e, 0x00, 0x00,
  285. 0xff, 0xff, 0xa7, 0xea, 0x3c, 0x30, 0x44, 0x03, 0x00, 0x00,
  286. }
  287. // Reference imports to suppress errors if they are not otherwise used.
  288. var _ context.Context
  289. var _ grpc.ClientConnInterface
  290. // This is a compile-time assertion to ensure that this generated file
  291. // is compatible with the grpc package it is being compiled against.
  292. const _ = grpc.SupportPackageIsVersion6
  293. // RemoteControlClient is the client API for RemoteControl service.
  294. //
  295. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  296. type RemoteControlClient interface {
  297. GetConfiguration(ctx context.Context, in *None, opts ...grpc.CallOption) (*Configuration, error)
  298. Activations(ctx context.Context, in *None, opts ...grpc.CallOption) (RemoteControl_ActivationsClient, error)
  299. Biases(ctx context.Context, in *None, opts ...grpc.CallOption) (RemoteControl_BiasesClient, error)
  300. Weights(ctx context.Context, in *None, opts ...grpc.CallOption) (RemoteControl_WeightsClient, error)
  301. State(ctx context.Context, in *None, opts ...grpc.CallOption) (RemoteControl_StateClient, error)
  302. }
  303. type remoteControlClient struct {
  304. cc grpc.ClientConnInterface
  305. }
  306. func NewRemoteControlClient(cc grpc.ClientConnInterface) RemoteControlClient {
  307. return &remoteControlClient{cc}
  308. }
  309. func (c *remoteControlClient) GetConfiguration(ctx context.Context, in *None, opts ...grpc.CallOption) (*Configuration, error) {
  310. out := new(Configuration)
  311. err := c.cc.Invoke(ctx, "/remotecontrol.RemoteControl/getConfiguration", in, out, opts...)
  312. if err != nil {
  313. return nil, err
  314. }
  315. return out, nil
  316. }
  317. func (c *remoteControlClient) Activations(ctx context.Context, in *None, opts ...grpc.CallOption) (RemoteControl_ActivationsClient, error) {
  318. stream, err := c.cc.NewStream(ctx, &_RemoteControl_serviceDesc.Streams[0], "/remotecontrol.RemoteControl/Activations", opts...)
  319. if err != nil {
  320. return nil, err
  321. }
  322. x := &remoteControlActivationsClient{stream}
  323. if err := x.ClientStream.SendMsg(in); err != nil {
  324. return nil, err
  325. }
  326. if err := x.ClientStream.CloseSend(); err != nil {
  327. return nil, err
  328. }
  329. return x, nil
  330. }
  331. type RemoteControl_ActivationsClient interface {
  332. Recv() (*LayerMatrix, error)
  333. grpc.ClientStream
  334. }
  335. type remoteControlActivationsClient struct {
  336. grpc.ClientStream
  337. }
  338. func (x *remoteControlActivationsClient) Recv() (*LayerMatrix, error) {
  339. m := new(LayerMatrix)
  340. if err := x.ClientStream.RecvMsg(m); err != nil {
  341. return nil, err
  342. }
  343. return m, nil
  344. }
  345. func (c *remoteControlClient) Biases(ctx context.Context, in *None, opts ...grpc.CallOption) (RemoteControl_BiasesClient, error) {
  346. stream, err := c.cc.NewStream(ctx, &_RemoteControl_serviceDesc.Streams[1], "/remotecontrol.RemoteControl/Biases", opts...)
  347. if err != nil {
  348. return nil, err
  349. }
  350. x := &remoteControlBiasesClient{stream}
  351. if err := x.ClientStream.SendMsg(in); err != nil {
  352. return nil, err
  353. }
  354. if err := x.ClientStream.CloseSend(); err != nil {
  355. return nil, err
  356. }
  357. return x, nil
  358. }
  359. type RemoteControl_BiasesClient interface {
  360. Recv() (*LayerMatrix, error)
  361. grpc.ClientStream
  362. }
  363. type remoteControlBiasesClient struct {
  364. grpc.ClientStream
  365. }
  366. func (x *remoteControlBiasesClient) Recv() (*LayerMatrix, error) {
  367. m := new(LayerMatrix)
  368. if err := x.ClientStream.RecvMsg(m); err != nil {
  369. return nil, err
  370. }
  371. return m, nil
  372. }
  373. func (c *remoteControlClient) Weights(ctx context.Context, in *None, opts ...grpc.CallOption) (RemoteControl_WeightsClient, error) {
  374. stream, err := c.cc.NewStream(ctx, &_RemoteControl_serviceDesc.Streams[2], "/remotecontrol.RemoteControl/Weights", opts...)
  375. if err != nil {
  376. return nil, err
  377. }
  378. x := &remoteControlWeightsClient{stream}
  379. if err := x.ClientStream.SendMsg(in); err != nil {
  380. return nil, err
  381. }
  382. if err := x.ClientStream.CloseSend(); err != nil {
  383. return nil, err
  384. }
  385. return x, nil
  386. }
  387. type RemoteControl_WeightsClient interface {
  388. Recv() (*LayerMatrix, error)
  389. grpc.ClientStream
  390. }
  391. type remoteControlWeightsClient struct {
  392. grpc.ClientStream
  393. }
  394. func (x *remoteControlWeightsClient) Recv() (*LayerMatrix, error) {
  395. m := new(LayerMatrix)
  396. if err := x.ClientStream.RecvMsg(m); err != nil {
  397. return nil, err
  398. }
  399. return m, nil
  400. }
  401. func (c *remoteControlClient) State(ctx context.Context, in *None, opts ...grpc.CallOption) (RemoteControl_StateClient, error) {
  402. stream, err := c.cc.NewStream(ctx, &_RemoteControl_serviceDesc.Streams[3], "/remotecontrol.RemoteControl/State", opts...)
  403. if err != nil {
  404. return nil, err
  405. }
  406. x := &remoteControlStateClient{stream}
  407. if err := x.ClientStream.SendMsg(in); err != nil {
  408. return nil, err
  409. }
  410. if err := x.ClientStream.CloseSend(); err != nil {
  411. return nil, err
  412. }
  413. return x, nil
  414. }
  415. type RemoteControl_StateClient interface {
  416. Recv() (*NetworkState, error)
  417. grpc.ClientStream
  418. }
  419. type remoteControlStateClient struct {
  420. grpc.ClientStream
  421. }
  422. func (x *remoteControlStateClient) Recv() (*NetworkState, error) {
  423. m := new(NetworkState)
  424. if err := x.ClientStream.RecvMsg(m); err != nil {
  425. return nil, err
  426. }
  427. return m, nil
  428. }
  429. // RemoteControlServer is the server API for RemoteControl service.
  430. type RemoteControlServer interface {
  431. GetConfiguration(context.Context, *None) (*Configuration, error)
  432. Activations(*None, RemoteControl_ActivationsServer) error
  433. Biases(*None, RemoteControl_BiasesServer) error
  434. Weights(*None, RemoteControl_WeightsServer) error
  435. State(*None, RemoteControl_StateServer) error
  436. }
  437. // UnimplementedRemoteControlServer can be embedded to have forward compatible implementations.
  438. type UnimplementedRemoteControlServer struct {
  439. }
  440. func (*UnimplementedRemoteControlServer) GetConfiguration(ctx context.Context, req *None) (*Configuration, error) {
  441. return nil, status.Errorf(codes.Unimplemented, "method GetConfiguration not implemented")
  442. }
  443. func (*UnimplementedRemoteControlServer) Activations(req *None, srv RemoteControl_ActivationsServer) error {
  444. return status.Errorf(codes.Unimplemented, "method Activations not implemented")
  445. }
  446. func (*UnimplementedRemoteControlServer) Biases(req *None, srv RemoteControl_BiasesServer) error {
  447. return status.Errorf(codes.Unimplemented, "method Biases not implemented")
  448. }
  449. func (*UnimplementedRemoteControlServer) Weights(req *None, srv RemoteControl_WeightsServer) error {
  450. return status.Errorf(codes.Unimplemented, "method Weights not implemented")
  451. }
  452. func (*UnimplementedRemoteControlServer) State(req *None, srv RemoteControl_StateServer) error {
  453. return status.Errorf(codes.Unimplemented, "method State not implemented")
  454. }
  455. func RegisterRemoteControlServer(s *grpc.Server, srv RemoteControlServer) {
  456. s.RegisterService(&_RemoteControl_serviceDesc, srv)
  457. }
  458. func _RemoteControl_GetConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  459. in := new(None)
  460. if err := dec(in); err != nil {
  461. return nil, err
  462. }
  463. if interceptor == nil {
  464. return srv.(RemoteControlServer).GetConfiguration(ctx, in)
  465. }
  466. info := &grpc.UnaryServerInfo{
  467. Server: srv,
  468. FullMethod: "/remotecontrol.RemoteControl/GetConfiguration",
  469. }
  470. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  471. return srv.(RemoteControlServer).GetConfiguration(ctx, req.(*None))
  472. }
  473. return interceptor(ctx, in, info, handler)
  474. }
  475. func _RemoteControl_Activations_Handler(srv interface{}, stream grpc.ServerStream) error {
  476. m := new(None)
  477. if err := stream.RecvMsg(m); err != nil {
  478. return err
  479. }
  480. return srv.(RemoteControlServer).Activations(m, &remoteControlActivationsServer{stream})
  481. }
  482. type RemoteControl_ActivationsServer interface {
  483. Send(*LayerMatrix) error
  484. grpc.ServerStream
  485. }
  486. type remoteControlActivationsServer struct {
  487. grpc.ServerStream
  488. }
  489. func (x *remoteControlActivationsServer) Send(m *LayerMatrix) error {
  490. return x.ServerStream.SendMsg(m)
  491. }
  492. func _RemoteControl_Biases_Handler(srv interface{}, stream grpc.ServerStream) error {
  493. m := new(None)
  494. if err := stream.RecvMsg(m); err != nil {
  495. return err
  496. }
  497. return srv.(RemoteControlServer).Biases(m, &remoteControlBiasesServer{stream})
  498. }
  499. type RemoteControl_BiasesServer interface {
  500. Send(*LayerMatrix) error
  501. grpc.ServerStream
  502. }
  503. type remoteControlBiasesServer struct {
  504. grpc.ServerStream
  505. }
  506. func (x *remoteControlBiasesServer) Send(m *LayerMatrix) error {
  507. return x.ServerStream.SendMsg(m)
  508. }
  509. func _RemoteControl_Weights_Handler(srv interface{}, stream grpc.ServerStream) error {
  510. m := new(None)
  511. if err := stream.RecvMsg(m); err != nil {
  512. return err
  513. }
  514. return srv.(RemoteControlServer).Weights(m, &remoteControlWeightsServer{stream})
  515. }
  516. type RemoteControl_WeightsServer interface {
  517. Send(*LayerMatrix) error
  518. grpc.ServerStream
  519. }
  520. type remoteControlWeightsServer struct {
  521. grpc.ServerStream
  522. }
  523. func (x *remoteControlWeightsServer) Send(m *LayerMatrix) error {
  524. return x.ServerStream.SendMsg(m)
  525. }
  526. func _RemoteControl_State_Handler(srv interface{}, stream grpc.ServerStream) error {
  527. m := new(None)
  528. if err := stream.RecvMsg(m); err != nil {
  529. return err
  530. }
  531. return srv.(RemoteControlServer).State(m, &remoteControlStateServer{stream})
  532. }
  533. type RemoteControl_StateServer interface {
  534. Send(*NetworkState) error
  535. grpc.ServerStream
  536. }
  537. type remoteControlStateServer struct {
  538. grpc.ServerStream
  539. }
  540. func (x *remoteControlStateServer) Send(m *NetworkState) error {
  541. return x.ServerStream.SendMsg(m)
  542. }
  543. var _RemoteControl_serviceDesc = grpc.ServiceDesc{
  544. ServiceName: "remotecontrol.RemoteControl",
  545. HandlerType: (*RemoteControlServer)(nil),
  546. Methods: []grpc.MethodDesc{
  547. {
  548. MethodName: "getConfiguration",
  549. Handler: _RemoteControl_GetConfiguration_Handler,
  550. },
  551. },
  552. Streams: []grpc.StreamDesc{
  553. {
  554. StreamName: "Activations",
  555. Handler: _RemoteControl_Activations_Handler,
  556. ServerStreams: true,
  557. },
  558. {
  559. StreamName: "Biases",
  560. Handler: _RemoteControl_Biases_Handler,
  561. ServerStreams: true,
  562. },
  563. {
  564. StreamName: "Weights",
  565. Handler: _RemoteControl_Weights_Handler,
  566. ServerStreams: true,
  567. },
  568. {
  569. StreamName: "State",
  570. Handler: _RemoteControl_State_Handler,
  571. ServerStreams: true,
  572. },
  573. },
  574. Metadata: "remotecontrol.proto",
  575. }