proto-gorm.pb.gw.go 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071
  1. // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
  2. // source: proto-gorm/api/proto-gorm.proto
  3. /*
  4. Package proto_gorm is a reverse proxy.
  5. It translates gRPC into RESTful JSON APIs.
  6. */
  7. package proto_gorm
  8. import (
  9. "context"
  10. "io"
  11. "net/http"
  12. "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
  13. "github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
  14. "google.golang.org/grpc"
  15. "google.golang.org/grpc/codes"
  16. "google.golang.org/grpc/grpclog"
  17. "google.golang.org/grpc/metadata"
  18. "google.golang.org/grpc/status"
  19. "google.golang.org/protobuf/proto"
  20. )
  21. // Suppress "imported and not used" errors
  22. var _ codes.Code
  23. var _ io.Reader
  24. var _ status.Status
  25. var _ = runtime.String
  26. var _ = utilities.NewDoubleArray
  27. var _ = metadata.Join
  28. func request_IntPointService_Create_0(ctx context.Context, marshaler runtime.Marshaler, client IntPointServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  29. var protoReq CreateIntPointRequest
  30. var metadata runtime.ServerMetadata
  31. newReader, berr := utilities.IOReaderFactory(req.Body)
  32. if berr != nil {
  33. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  34. }
  35. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Payload); err != nil && err != io.EOF {
  36. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  37. }
  38. msg, err := client.Create(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
  39. return msg, metadata, err
  40. }
  41. func local_request_IntPointService_Create_0(ctx context.Context, marshaler runtime.Marshaler, server IntPointServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  42. var protoReq CreateIntPointRequest
  43. var metadata runtime.ServerMetadata
  44. newReader, berr := utilities.IOReaderFactory(req.Body)
  45. if berr != nil {
  46. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  47. }
  48. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Payload); err != nil && err != io.EOF {
  49. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  50. }
  51. msg, err := server.Create(ctx, &protoReq)
  52. return msg, metadata, err
  53. }
  54. var (
  55. filter_IntPointService_Read_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
  56. )
  57. func request_IntPointService_Read_0(ctx context.Context, marshaler runtime.Marshaler, client IntPointServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  58. var protoReq ReadIntPointRequest
  59. var metadata runtime.ServerMetadata
  60. var (
  61. val string
  62. ok bool
  63. err error
  64. _ = err
  65. )
  66. val, ok = pathParams["id"]
  67. if !ok {
  68. return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
  69. }
  70. protoReq.Id, err = runtime.Uint32(val)
  71. if err != nil {
  72. return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
  73. }
  74. if err := req.ParseForm(); err != nil {
  75. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  76. }
  77. if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IntPointService_Read_0); err != nil {
  78. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  79. }
  80. msg, err := client.Read(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
  81. return msg, metadata, err
  82. }
  83. func local_request_IntPointService_Read_0(ctx context.Context, marshaler runtime.Marshaler, server IntPointServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  84. var protoReq ReadIntPointRequest
  85. var metadata runtime.ServerMetadata
  86. var (
  87. val string
  88. ok bool
  89. err error
  90. _ = err
  91. )
  92. val, ok = pathParams["id"]
  93. if !ok {
  94. return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
  95. }
  96. protoReq.Id, err = runtime.Uint32(val)
  97. if err != nil {
  98. return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
  99. }
  100. if err := req.ParseForm(); err != nil {
  101. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  102. }
  103. if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IntPointService_Read_0); err != nil {
  104. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  105. }
  106. msg, err := server.Read(ctx, &protoReq)
  107. return msg, metadata, err
  108. }
  109. var (
  110. filter_IntPointService_Update_0 = &utilities.DoubleArray{Encoding: map[string]int{"payload": 0, "id": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
  111. )
  112. func request_IntPointService_Update_0(ctx context.Context, marshaler runtime.Marshaler, client IntPointServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  113. var protoReq UpdateIntPointRequest
  114. var metadata runtime.ServerMetadata
  115. newReader, berr := utilities.IOReaderFactory(req.Body)
  116. if berr != nil {
  117. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  118. }
  119. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Payload); err != nil && err != io.EOF {
  120. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  121. }
  122. if protoReq.GerogeriGegege == nil || len(protoReq.GerogeriGegege.GetPaths()) == 0 {
  123. if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Payload); err != nil {
  124. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  125. } else {
  126. protoReq.GerogeriGegege = fieldMask
  127. }
  128. }
  129. var (
  130. val string
  131. ok bool
  132. err error
  133. _ = err
  134. )
  135. val, ok = pathParams["payload.id"]
  136. if !ok {
  137. return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payload.id")
  138. }
  139. err = runtime.PopulateFieldFromPath(&protoReq, "payload.id", val)
  140. if err != nil {
  141. return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payload.id", err)
  142. }
  143. if err := req.ParseForm(); err != nil {
  144. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  145. }
  146. if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IntPointService_Update_0); err != nil {
  147. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  148. }
  149. msg, err := client.Update(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
  150. return msg, metadata, err
  151. }
  152. func local_request_IntPointService_Update_0(ctx context.Context, marshaler runtime.Marshaler, server IntPointServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  153. var protoReq UpdateIntPointRequest
  154. var metadata runtime.ServerMetadata
  155. newReader, berr := utilities.IOReaderFactory(req.Body)
  156. if berr != nil {
  157. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  158. }
  159. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Payload); err != nil && err != io.EOF {
  160. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  161. }
  162. if protoReq.GerogeriGegege == nil || len(protoReq.GerogeriGegege.GetPaths()) == 0 {
  163. if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Payload); err != nil {
  164. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  165. } else {
  166. protoReq.GerogeriGegege = fieldMask
  167. }
  168. }
  169. var (
  170. val string
  171. ok bool
  172. err error
  173. _ = err
  174. )
  175. val, ok = pathParams["payload.id"]
  176. if !ok {
  177. return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payload.id")
  178. }
  179. err = runtime.PopulateFieldFromPath(&protoReq, "payload.id", val)
  180. if err != nil {
  181. return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payload.id", err)
  182. }
  183. if err := req.ParseForm(); err != nil {
  184. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  185. }
  186. if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IntPointService_Update_0); err != nil {
  187. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  188. }
  189. msg, err := server.Update(ctx, &protoReq)
  190. return msg, metadata, err
  191. }
  192. func request_IntPointService_UpdateSet_0(ctx context.Context, marshaler runtime.Marshaler, client IntPointServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  193. var protoReq UpdateSetIntPointRequest
  194. var metadata runtime.ServerMetadata
  195. newReader, berr := utilities.IOReaderFactory(req.Body)
  196. if berr != nil {
  197. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  198. }
  199. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  200. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  201. }
  202. msg, err := client.UpdateSet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
  203. return msg, metadata, err
  204. }
  205. func local_request_IntPointService_UpdateSet_0(ctx context.Context, marshaler runtime.Marshaler, server IntPointServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  206. var protoReq UpdateSetIntPointRequest
  207. var metadata runtime.ServerMetadata
  208. newReader, berr := utilities.IOReaderFactory(req.Body)
  209. if berr != nil {
  210. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  211. }
  212. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  213. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  214. }
  215. msg, err := server.UpdateSet(ctx, &protoReq)
  216. return msg, metadata, err
  217. }
  218. func request_IntPointService_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client IntPointServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  219. var protoReq DeleteIntPointRequest
  220. var metadata runtime.ServerMetadata
  221. var (
  222. val string
  223. ok bool
  224. err error
  225. _ = err
  226. )
  227. val, ok = pathParams["id"]
  228. if !ok {
  229. return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
  230. }
  231. protoReq.Id, err = runtime.Uint32(val)
  232. if err != nil {
  233. return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
  234. }
  235. msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
  236. return msg, metadata, err
  237. }
  238. func local_request_IntPointService_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server IntPointServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  239. var protoReq DeleteIntPointRequest
  240. var metadata runtime.ServerMetadata
  241. var (
  242. val string
  243. ok bool
  244. err error
  245. _ = err
  246. )
  247. val, ok = pathParams["id"]
  248. if !ok {
  249. return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
  250. }
  251. protoReq.Id, err = runtime.Uint32(val)
  252. if err != nil {
  253. return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
  254. }
  255. msg, err := server.Delete(ctx, &protoReq)
  256. return msg, metadata, err
  257. }
  258. func request_IntPointTxn_Create_0(ctx context.Context, marshaler runtime.Marshaler, client IntPointTxnClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  259. var protoReq CreateIntPointRequest
  260. var metadata runtime.ServerMetadata
  261. newReader, berr := utilities.IOReaderFactory(req.Body)
  262. if berr != nil {
  263. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  264. }
  265. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  266. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  267. }
  268. msg, err := client.Create(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
  269. return msg, metadata, err
  270. }
  271. func local_request_IntPointTxn_Create_0(ctx context.Context, marshaler runtime.Marshaler, server IntPointTxnServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  272. var protoReq CreateIntPointRequest
  273. var metadata runtime.ServerMetadata
  274. newReader, berr := utilities.IOReaderFactory(req.Body)
  275. if berr != nil {
  276. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  277. }
  278. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  279. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  280. }
  281. msg, err := server.Create(ctx, &protoReq)
  282. return msg, metadata, err
  283. }
  284. func request_IntPointTxn_Read_0(ctx context.Context, marshaler runtime.Marshaler, client IntPointTxnClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  285. var protoReq ReadIntPointRequest
  286. var metadata runtime.ServerMetadata
  287. newReader, berr := utilities.IOReaderFactory(req.Body)
  288. if berr != nil {
  289. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  290. }
  291. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  292. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  293. }
  294. msg, err := client.Read(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
  295. return msg, metadata, err
  296. }
  297. func local_request_IntPointTxn_Read_0(ctx context.Context, marshaler runtime.Marshaler, server IntPointTxnServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  298. var protoReq ReadIntPointRequest
  299. var metadata runtime.ServerMetadata
  300. newReader, berr := utilities.IOReaderFactory(req.Body)
  301. if berr != nil {
  302. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  303. }
  304. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  305. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  306. }
  307. msg, err := server.Read(ctx, &protoReq)
  308. return msg, metadata, err
  309. }
  310. func request_IntPointTxn_Update_0(ctx context.Context, marshaler runtime.Marshaler, client IntPointTxnClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  311. var protoReq UpdateIntPointRequest
  312. var metadata runtime.ServerMetadata
  313. newReader, berr := utilities.IOReaderFactory(req.Body)
  314. if berr != nil {
  315. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  316. }
  317. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  318. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  319. }
  320. msg, err := client.Update(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
  321. return msg, metadata, err
  322. }
  323. func local_request_IntPointTxn_Update_0(ctx context.Context, marshaler runtime.Marshaler, server IntPointTxnServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  324. var protoReq UpdateIntPointRequest
  325. var metadata runtime.ServerMetadata
  326. newReader, berr := utilities.IOReaderFactory(req.Body)
  327. if berr != nil {
  328. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  329. }
  330. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  331. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  332. }
  333. msg, err := server.Update(ctx, &protoReq)
  334. return msg, metadata, err
  335. }
  336. func request_IntPointTxn_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client IntPointTxnClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  337. var protoReq DeleteIntPointRequest
  338. var metadata runtime.ServerMetadata
  339. newReader, berr := utilities.IOReaderFactory(req.Body)
  340. if berr != nil {
  341. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  342. }
  343. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  344. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  345. }
  346. msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
  347. return msg, metadata, err
  348. }
  349. func local_request_IntPointTxn_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server IntPointTxnServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  350. var protoReq DeleteIntPointRequest
  351. var metadata runtime.ServerMetadata
  352. newReader, berr := utilities.IOReaderFactory(req.Body)
  353. if berr != nil {
  354. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  355. }
  356. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  357. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  358. }
  359. msg, err := server.Delete(ctx, &protoReq)
  360. return msg, metadata, err
  361. }
  362. func request_IntPointTxn_DeleteSet_0(ctx context.Context, marshaler runtime.Marshaler, client IntPointTxnClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  363. var protoReq DeleteIntPointsRequest
  364. var metadata runtime.ServerMetadata
  365. newReader, berr := utilities.IOReaderFactory(req.Body)
  366. if berr != nil {
  367. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  368. }
  369. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  370. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  371. }
  372. msg, err := client.DeleteSet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
  373. return msg, metadata, err
  374. }
  375. func local_request_IntPointTxn_DeleteSet_0(ctx context.Context, marshaler runtime.Marshaler, server IntPointTxnServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
  376. var protoReq DeleteIntPointsRequest
  377. var metadata runtime.ServerMetadata
  378. newReader, berr := utilities.IOReaderFactory(req.Body)
  379. if berr != nil {
  380. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
  381. }
  382. if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
  383. return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
  384. }
  385. msg, err := server.DeleteSet(ctx, &protoReq)
  386. return msg, metadata, err
  387. }
  388. // RegisterIntPointServiceHandlerServer registers the http handlers for service IntPointService to "mux".
  389. // UnaryRPC :call IntPointServiceServer directly.
  390. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
  391. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterIntPointServiceHandlerFromEndpoint instead.
  392. func RegisterIntPointServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IntPointServiceServer) error {
  393. mux.Handle("POST", pattern_IntPointService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  394. ctx, cancel := context.WithCancel(req.Context())
  395. defer cancel()
  396. var stream runtime.ServerTransportStream
  397. ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
  398. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  399. rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto_gorm.IntPointService/Create", runtime.WithHTTPPathPattern("/v1/point"))
  400. if err != nil {
  401. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  402. return
  403. }
  404. resp, md, err := local_request_IntPointService_Create_0(rctx, inboundMarshaler, server, req, pathParams)
  405. md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
  406. ctx = runtime.NewServerMetadataContext(ctx, md)
  407. if err != nil {
  408. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  409. return
  410. }
  411. forward_IntPointService_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  412. })
  413. mux.Handle("GET", pattern_IntPointService_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  414. ctx, cancel := context.WithCancel(req.Context())
  415. defer cancel()
  416. var stream runtime.ServerTransportStream
  417. ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
  418. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  419. rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto_gorm.IntPointService/Read", runtime.WithHTTPPathPattern("/v1/point/{id}"))
  420. if err != nil {
  421. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  422. return
  423. }
  424. resp, md, err := local_request_IntPointService_Read_0(rctx, inboundMarshaler, server, req, pathParams)
  425. md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
  426. ctx = runtime.NewServerMetadataContext(ctx, md)
  427. if err != nil {
  428. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  429. return
  430. }
  431. forward_IntPointService_Read_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  432. })
  433. mux.Handle("PATCH", pattern_IntPointService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  434. ctx, cancel := context.WithCancel(req.Context())
  435. defer cancel()
  436. var stream runtime.ServerTransportStream
  437. ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
  438. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  439. rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto_gorm.IntPointService/Update", runtime.WithHTTPPathPattern("/v1/point/{payload.id}"))
  440. if err != nil {
  441. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  442. return
  443. }
  444. resp, md, err := local_request_IntPointService_Update_0(rctx, inboundMarshaler, server, req, pathParams)
  445. md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
  446. ctx = runtime.NewServerMetadataContext(ctx, md)
  447. if err != nil {
  448. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  449. return
  450. }
  451. forward_IntPointService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  452. })
  453. mux.Handle("POST", pattern_IntPointService_UpdateSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  454. ctx, cancel := context.WithCancel(req.Context())
  455. defer cancel()
  456. var stream runtime.ServerTransportStream
  457. ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
  458. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  459. rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto_gorm.IntPointService/UpdateSet", runtime.WithHTTPPathPattern("/proto_gorm.IntPointService/UpdateSet"))
  460. if err != nil {
  461. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  462. return
  463. }
  464. resp, md, err := local_request_IntPointService_UpdateSet_0(rctx, inboundMarshaler, server, req, pathParams)
  465. md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
  466. ctx = runtime.NewServerMetadataContext(ctx, md)
  467. if err != nil {
  468. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  469. return
  470. }
  471. forward_IntPointService_UpdateSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  472. })
  473. mux.Handle("DELETE", pattern_IntPointService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  474. ctx, cancel := context.WithCancel(req.Context())
  475. defer cancel()
  476. var stream runtime.ServerTransportStream
  477. ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
  478. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  479. rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto_gorm.IntPointService/Delete", runtime.WithHTTPPathPattern("/v1/point/{id}"))
  480. if err != nil {
  481. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  482. return
  483. }
  484. resp, md, err := local_request_IntPointService_Delete_0(rctx, inboundMarshaler, server, req, pathParams)
  485. md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
  486. ctx = runtime.NewServerMetadataContext(ctx, md)
  487. if err != nil {
  488. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  489. return
  490. }
  491. forward_IntPointService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  492. })
  493. return nil
  494. }
  495. // RegisterIntPointTxnHandlerServer registers the http handlers for service IntPointTxn to "mux".
  496. // UnaryRPC :call IntPointTxnServer directly.
  497. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
  498. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterIntPointTxnHandlerFromEndpoint instead.
  499. func RegisterIntPointTxnHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IntPointTxnServer) error {
  500. mux.Handle("POST", pattern_IntPointTxn_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  501. ctx, cancel := context.WithCancel(req.Context())
  502. defer cancel()
  503. var stream runtime.ServerTransportStream
  504. ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
  505. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  506. rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto_gorm.IntPointTxn/Create", runtime.WithHTTPPathPattern("/proto_gorm.IntPointTxn/Create"))
  507. if err != nil {
  508. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  509. return
  510. }
  511. resp, md, err := local_request_IntPointTxn_Create_0(rctx, inboundMarshaler, server, req, pathParams)
  512. md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
  513. ctx = runtime.NewServerMetadataContext(ctx, md)
  514. if err != nil {
  515. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  516. return
  517. }
  518. forward_IntPointTxn_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  519. })
  520. mux.Handle("POST", pattern_IntPointTxn_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  521. ctx, cancel := context.WithCancel(req.Context())
  522. defer cancel()
  523. var stream runtime.ServerTransportStream
  524. ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
  525. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  526. rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto_gorm.IntPointTxn/Read", runtime.WithHTTPPathPattern("/proto_gorm.IntPointTxn/Read"))
  527. if err != nil {
  528. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  529. return
  530. }
  531. resp, md, err := local_request_IntPointTxn_Read_0(rctx, inboundMarshaler, server, req, pathParams)
  532. md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
  533. ctx = runtime.NewServerMetadataContext(ctx, md)
  534. if err != nil {
  535. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  536. return
  537. }
  538. forward_IntPointTxn_Read_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  539. })
  540. mux.Handle("POST", pattern_IntPointTxn_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  541. ctx, cancel := context.WithCancel(req.Context())
  542. defer cancel()
  543. var stream runtime.ServerTransportStream
  544. ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
  545. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  546. rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto_gorm.IntPointTxn/Update", runtime.WithHTTPPathPattern("/proto_gorm.IntPointTxn/Update"))
  547. if err != nil {
  548. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  549. return
  550. }
  551. resp, md, err := local_request_IntPointTxn_Update_0(rctx, inboundMarshaler, server, req, pathParams)
  552. md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
  553. ctx = runtime.NewServerMetadataContext(ctx, md)
  554. if err != nil {
  555. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  556. return
  557. }
  558. forward_IntPointTxn_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  559. })
  560. mux.Handle("POST", pattern_IntPointTxn_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  561. ctx, cancel := context.WithCancel(req.Context())
  562. defer cancel()
  563. var stream runtime.ServerTransportStream
  564. ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
  565. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  566. rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto_gorm.IntPointTxn/Delete", runtime.WithHTTPPathPattern("/proto_gorm.IntPointTxn/Delete"))
  567. if err != nil {
  568. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  569. return
  570. }
  571. resp, md, err := local_request_IntPointTxn_Delete_0(rctx, inboundMarshaler, server, req, pathParams)
  572. md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
  573. ctx = runtime.NewServerMetadataContext(ctx, md)
  574. if err != nil {
  575. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  576. return
  577. }
  578. forward_IntPointTxn_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  579. })
  580. mux.Handle("POST", pattern_IntPointTxn_DeleteSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  581. ctx, cancel := context.WithCancel(req.Context())
  582. defer cancel()
  583. var stream runtime.ServerTransportStream
  584. ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
  585. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  586. rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto_gorm.IntPointTxn/DeleteSet", runtime.WithHTTPPathPattern("/proto_gorm.IntPointTxn/DeleteSet"))
  587. if err != nil {
  588. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  589. return
  590. }
  591. resp, md, err := local_request_IntPointTxn_DeleteSet_0(rctx, inboundMarshaler, server, req, pathParams)
  592. md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
  593. ctx = runtime.NewServerMetadataContext(ctx, md)
  594. if err != nil {
  595. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  596. return
  597. }
  598. forward_IntPointTxn_DeleteSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  599. })
  600. return nil
  601. }
  602. // RegisterIntPointServiceHandlerFromEndpoint is same as RegisterIntPointServiceHandler but
  603. // automatically dials to "endpoint" and closes the connection when "ctx" gets done.
  604. func RegisterIntPointServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
  605. conn, err := grpc.Dial(endpoint, opts...)
  606. if err != nil {
  607. return err
  608. }
  609. defer func() {
  610. if err != nil {
  611. if cerr := conn.Close(); cerr != nil {
  612. grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
  613. }
  614. return
  615. }
  616. go func() {
  617. <-ctx.Done()
  618. if cerr := conn.Close(); cerr != nil {
  619. grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
  620. }
  621. }()
  622. }()
  623. return RegisterIntPointServiceHandler(ctx, mux, conn)
  624. }
  625. // RegisterIntPointServiceHandler registers the http handlers for service IntPointService to "mux".
  626. // The handlers forward requests to the grpc endpoint over "conn".
  627. func RegisterIntPointServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
  628. return RegisterIntPointServiceHandlerClient(ctx, mux, NewIntPointServiceClient(conn))
  629. }
  630. // RegisterIntPointServiceHandlerClient registers the http handlers for service IntPointService
  631. // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "IntPointServiceClient".
  632. // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "IntPointServiceClient"
  633. // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
  634. // "IntPointServiceClient" to call the correct interceptors.
  635. func RegisterIntPointServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IntPointServiceClient) error {
  636. mux.Handle("POST", pattern_IntPointService_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  637. ctx, cancel := context.WithCancel(req.Context())
  638. defer cancel()
  639. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  640. rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto_gorm.IntPointService/Create", runtime.WithHTTPPathPattern("/v1/point"))
  641. if err != nil {
  642. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  643. return
  644. }
  645. resp, md, err := request_IntPointService_Create_0(rctx, inboundMarshaler, client, req, pathParams)
  646. ctx = runtime.NewServerMetadataContext(ctx, md)
  647. if err != nil {
  648. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  649. return
  650. }
  651. forward_IntPointService_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  652. })
  653. mux.Handle("GET", pattern_IntPointService_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  654. ctx, cancel := context.WithCancel(req.Context())
  655. defer cancel()
  656. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  657. rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto_gorm.IntPointService/Read", runtime.WithHTTPPathPattern("/v1/point/{id}"))
  658. if err != nil {
  659. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  660. return
  661. }
  662. resp, md, err := request_IntPointService_Read_0(rctx, inboundMarshaler, client, req, pathParams)
  663. ctx = runtime.NewServerMetadataContext(ctx, md)
  664. if err != nil {
  665. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  666. return
  667. }
  668. forward_IntPointService_Read_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  669. })
  670. mux.Handle("PATCH", pattern_IntPointService_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  671. ctx, cancel := context.WithCancel(req.Context())
  672. defer cancel()
  673. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  674. rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto_gorm.IntPointService/Update", runtime.WithHTTPPathPattern("/v1/point/{payload.id}"))
  675. if err != nil {
  676. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  677. return
  678. }
  679. resp, md, err := request_IntPointService_Update_0(rctx, inboundMarshaler, client, req, pathParams)
  680. ctx = runtime.NewServerMetadataContext(ctx, md)
  681. if err != nil {
  682. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  683. return
  684. }
  685. forward_IntPointService_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  686. })
  687. mux.Handle("POST", pattern_IntPointService_UpdateSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  688. ctx, cancel := context.WithCancel(req.Context())
  689. defer cancel()
  690. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  691. rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto_gorm.IntPointService/UpdateSet", runtime.WithHTTPPathPattern("/proto_gorm.IntPointService/UpdateSet"))
  692. if err != nil {
  693. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  694. return
  695. }
  696. resp, md, err := request_IntPointService_UpdateSet_0(rctx, inboundMarshaler, client, req, pathParams)
  697. ctx = runtime.NewServerMetadataContext(ctx, md)
  698. if err != nil {
  699. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  700. return
  701. }
  702. forward_IntPointService_UpdateSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  703. })
  704. mux.Handle("DELETE", pattern_IntPointService_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  705. ctx, cancel := context.WithCancel(req.Context())
  706. defer cancel()
  707. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  708. rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto_gorm.IntPointService/Delete", runtime.WithHTTPPathPattern("/v1/point/{id}"))
  709. if err != nil {
  710. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  711. return
  712. }
  713. resp, md, err := request_IntPointService_Delete_0(rctx, inboundMarshaler, client, req, pathParams)
  714. ctx = runtime.NewServerMetadataContext(ctx, md)
  715. if err != nil {
  716. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  717. return
  718. }
  719. forward_IntPointService_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  720. })
  721. return nil
  722. }
  723. var (
  724. pattern_IntPointService_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "point"}, ""))
  725. pattern_IntPointService_Read_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "point", "id"}, ""))
  726. pattern_IntPointService_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "point", "payload.id"}, ""))
  727. pattern_IntPointService_UpdateSet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"proto_gorm.IntPointService", "UpdateSet"}, ""))
  728. pattern_IntPointService_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "point", "id"}, ""))
  729. )
  730. var (
  731. forward_IntPointService_Create_0 = runtime.ForwardResponseMessage
  732. forward_IntPointService_Read_0 = runtime.ForwardResponseMessage
  733. forward_IntPointService_Update_0 = runtime.ForwardResponseMessage
  734. forward_IntPointService_UpdateSet_0 = runtime.ForwardResponseMessage
  735. forward_IntPointService_Delete_0 = runtime.ForwardResponseMessage
  736. )
  737. // RegisterIntPointTxnHandlerFromEndpoint is same as RegisterIntPointTxnHandler but
  738. // automatically dials to "endpoint" and closes the connection when "ctx" gets done.
  739. func RegisterIntPointTxnHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
  740. conn, err := grpc.Dial(endpoint, opts...)
  741. if err != nil {
  742. return err
  743. }
  744. defer func() {
  745. if err != nil {
  746. if cerr := conn.Close(); cerr != nil {
  747. grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
  748. }
  749. return
  750. }
  751. go func() {
  752. <-ctx.Done()
  753. if cerr := conn.Close(); cerr != nil {
  754. grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
  755. }
  756. }()
  757. }()
  758. return RegisterIntPointTxnHandler(ctx, mux, conn)
  759. }
  760. // RegisterIntPointTxnHandler registers the http handlers for service IntPointTxn to "mux".
  761. // The handlers forward requests to the grpc endpoint over "conn".
  762. func RegisterIntPointTxnHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
  763. return RegisterIntPointTxnHandlerClient(ctx, mux, NewIntPointTxnClient(conn))
  764. }
  765. // RegisterIntPointTxnHandlerClient registers the http handlers for service IntPointTxn
  766. // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "IntPointTxnClient".
  767. // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "IntPointTxnClient"
  768. // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
  769. // "IntPointTxnClient" to call the correct interceptors.
  770. func RegisterIntPointTxnHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IntPointTxnClient) error {
  771. mux.Handle("POST", pattern_IntPointTxn_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  772. ctx, cancel := context.WithCancel(req.Context())
  773. defer cancel()
  774. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  775. rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto_gorm.IntPointTxn/Create", runtime.WithHTTPPathPattern("/proto_gorm.IntPointTxn/Create"))
  776. if err != nil {
  777. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  778. return
  779. }
  780. resp, md, err := request_IntPointTxn_Create_0(rctx, inboundMarshaler, client, req, pathParams)
  781. ctx = runtime.NewServerMetadataContext(ctx, md)
  782. if err != nil {
  783. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  784. return
  785. }
  786. forward_IntPointTxn_Create_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  787. })
  788. mux.Handle("POST", pattern_IntPointTxn_Read_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  789. ctx, cancel := context.WithCancel(req.Context())
  790. defer cancel()
  791. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  792. rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto_gorm.IntPointTxn/Read", runtime.WithHTTPPathPattern("/proto_gorm.IntPointTxn/Read"))
  793. if err != nil {
  794. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  795. return
  796. }
  797. resp, md, err := request_IntPointTxn_Read_0(rctx, inboundMarshaler, client, req, pathParams)
  798. ctx = runtime.NewServerMetadataContext(ctx, md)
  799. if err != nil {
  800. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  801. return
  802. }
  803. forward_IntPointTxn_Read_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  804. })
  805. mux.Handle("POST", pattern_IntPointTxn_Update_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  806. ctx, cancel := context.WithCancel(req.Context())
  807. defer cancel()
  808. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  809. rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto_gorm.IntPointTxn/Update", runtime.WithHTTPPathPattern("/proto_gorm.IntPointTxn/Update"))
  810. if err != nil {
  811. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  812. return
  813. }
  814. resp, md, err := request_IntPointTxn_Update_0(rctx, inboundMarshaler, client, req, pathParams)
  815. ctx = runtime.NewServerMetadataContext(ctx, md)
  816. if err != nil {
  817. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  818. return
  819. }
  820. forward_IntPointTxn_Update_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  821. })
  822. mux.Handle("POST", pattern_IntPointTxn_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  823. ctx, cancel := context.WithCancel(req.Context())
  824. defer cancel()
  825. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  826. rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto_gorm.IntPointTxn/Delete", runtime.WithHTTPPathPattern("/proto_gorm.IntPointTxn/Delete"))
  827. if err != nil {
  828. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  829. return
  830. }
  831. resp, md, err := request_IntPointTxn_Delete_0(rctx, inboundMarshaler, client, req, pathParams)
  832. ctx = runtime.NewServerMetadataContext(ctx, md)
  833. if err != nil {
  834. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  835. return
  836. }
  837. forward_IntPointTxn_Delete_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  838. })
  839. mux.Handle("POST", pattern_IntPointTxn_DeleteSet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
  840. ctx, cancel := context.WithCancel(req.Context())
  841. defer cancel()
  842. inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
  843. rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto_gorm.IntPointTxn/DeleteSet", runtime.WithHTTPPathPattern("/proto_gorm.IntPointTxn/DeleteSet"))
  844. if err != nil {
  845. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  846. return
  847. }
  848. resp, md, err := request_IntPointTxn_DeleteSet_0(rctx, inboundMarshaler, client, req, pathParams)
  849. ctx = runtime.NewServerMetadataContext(ctx, md)
  850. if err != nil {
  851. runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
  852. return
  853. }
  854. forward_IntPointTxn_DeleteSet_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
  855. })
  856. return nil
  857. }
  858. var (
  859. pattern_IntPointTxn_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"proto_gorm.IntPointTxn", "Create"}, ""))
  860. pattern_IntPointTxn_Read_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"proto_gorm.IntPointTxn", "Read"}, ""))
  861. pattern_IntPointTxn_Update_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"proto_gorm.IntPointTxn", "Update"}, ""))
  862. pattern_IntPointTxn_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"proto_gorm.IntPointTxn", "Delete"}, ""))
  863. pattern_IntPointTxn_DeleteSet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"proto_gorm.IntPointTxn", "DeleteSet"}, ""))
  864. )
  865. var (
  866. forward_IntPointTxn_Create_0 = runtime.ForwardResponseMessage
  867. forward_IntPointTxn_Read_0 = runtime.ForwardResponseMessage
  868. forward_IntPointTxn_Update_0 = runtime.ForwardResponseMessage
  869. forward_IntPointTxn_Delete_0 = runtime.ForwardResponseMessage
  870. forward_IntPointTxn_DeleteSet_0 = runtime.ForwardResponseMessage
  871. )