gitee.com/h79/goutils@v1.22.10/thrift/redis_proxy/redis_processor.go (about) 1 package redis_proxy 2 3 import ( 4 "context" 5 "github.com/apache/thrift/lib/go/thrift" 6 ) 7 8 type processorBase struct { 9 cmd string 10 } 11 12 func (p *processorBase) Read(ctx context.Context, in, out thrift.TProtocol, args thrift.TStruct, seqId int32) (success bool, err thrift.TException) { 13 var err2 error 14 if err2 = args.Read(ctx, in); err2 != nil { 15 in.ReadMessageEnd(ctx) 16 exc := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) 17 in.WriteMessageBegin(ctx, p.cmd, thrift.EXCEPTION, seqId) 18 exc.Write(ctx, in) 19 in.WriteMessageEnd(ctx) 20 in.Flush(ctx) 21 return false, thrift.WrapTException(err2) 22 } 23 in.ReadMessageEnd(ctx) 24 return true, nil 25 } 26 27 func (p *processorBase) CmdException(ctx context.Context, in, out thrift.TProtocol, seqId int32, err2 error) (success bool, err thrift.TException) { 28 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing "+p.cmd+": "+err2.Error()) 29 in.WriteMessageBegin(ctx, p.cmd, thrift.EXCEPTION, seqId) 30 x.Write(ctx, in) 31 in.WriteMessageEnd(ctx) 32 in.Flush(ctx) 33 return false, thrift.WrapTException(err2) 34 } 35 36 func (p *processorBase) Cmd(ctx context.Context, in, out thrift.TProtocol, result thrift.TStruct, seqId int32) (success bool, err thrift.TException) { 37 var err2 error 38 if err2 = in.WriteMessageBegin(ctx, p.cmd, thrift.REPLY, seqId); err2 != nil { 39 err = thrift.WrapTException(err2) 40 } 41 if err2 = result.Write(ctx, in); err == nil && err2 != nil { 42 err = thrift.WrapTException(err2) 43 } 44 if err2 = in.WriteMessageEnd(ctx); err == nil && err2 != nil { 45 err = thrift.WrapTException(err2) 46 } 47 if err2 = in.Flush(ctx); err == nil && err2 != nil { 48 err = thrift.WrapTException(err2) 49 } 50 if err != nil { 51 return 52 } 53 return true, err 54 } 55 56 type processorPing struct { 57 processorBase 58 handler RedisProxy 59 } 60 61 func (p *processorPing) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 62 63 args := PingArgs{} 64 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 65 return false, err 66 } 67 result := PingResult{} 68 if ret, err2 := p.handler.Ping(ctx, args.Echo); err2 != nil { 69 return p.CmdException(ctx, in, out, seqId, err2) 70 } else { 71 result.Success = &ret 72 } 73 return p.Cmd(ctx, in, out, &result, seqId) 74 } 75 76 type processorRedisProxyPing struct { 77 processorBase 78 handler RedisProxy 79 } 80 81 func (p *processorRedisProxyPing) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 82 args := RedisProxyPingArgs{} 83 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 84 return false, err 85 } 86 87 result := RedisProxyPingResult{} 88 if ret, err2 := p.handler.Ping(ctx, args.Echo); err2 != nil { 89 return p.CmdException(ctx, in, out, seqId, err2) 90 } else { 91 result.Success = &ret 92 } 93 return p.Cmd(ctx, in, out, &result, seqId) 94 } 95 96 type processorGetSet struct { 97 processorBase 98 handler RedisProxy 99 } 100 101 func (p *processorGetSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 102 args := GetSetArgs{} 103 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 104 return false, err 105 } 106 107 result := GetSetResult{} 108 if ret, err2 := p.handler.GetSet(ctx, args.Appid, args.Key, args.Value); err2 != nil { 109 return p.CmdException(ctx, in, out, seqId, err2) 110 } else { 111 result.Success = ret 112 } 113 return p.Cmd(ctx, in, out, &result, seqId) 114 } 115 116 type processorGetSetBytes struct { 117 processorBase 118 handler RedisProxy 119 } 120 121 func (p *processorGetSetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 122 args := GetSetBytesArgs{} 123 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 124 return false, err 125 } 126 127 result := GetSetBytesResult{} 128 129 if ret, err2 := p.handler.GetSetBytes(ctx, args.Appid, args.Key, args.Value); err2 != nil { 130 return p.CmdException(ctx, in, out, seqId, err2) 131 } else { 132 result.Success = ret 133 } 134 return p.Cmd(ctx, in, out, &result, seqId) 135 } 136 137 type processorSet struct { 138 processorBase 139 handler RedisProxy 140 } 141 142 func (p *processorSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 143 args := SetArgs{} 144 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 145 return false, err 146 } 147 148 result := SetResult{} 149 if ret, err2 := p.handler.Set(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil { 150 return p.CmdException(ctx, in, out, seqId, err2) 151 } else { 152 result.Success = ret 153 } 154 return p.Cmd(ctx, in, out, &result, seqId) 155 } 156 157 type processorSetBytes struct { 158 processorBase 159 handler RedisProxy 160 } 161 162 func (p *processorSetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 163 args := SetBytesArgs{} 164 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 165 return false, err 166 } 167 168 result := RedisProxySetBytesResult{} 169 if ret, err2 := p.handler.SetBytes(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil { 170 return p.CmdException(ctx, in, out, seqId, err2) 171 } else { 172 result.Success = ret 173 } 174 return p.Cmd(ctx, in, out, &result, seqId) 175 } 176 177 type processorSetNX struct { 178 processorBase 179 handler RedisProxy 180 } 181 182 func (p *processorSetNX) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 183 args := SetNXArgs{} 184 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 185 return false, err 186 } 187 result := SetNXResult{} 188 if ret, err2 := p.handler.SetNX(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil { 189 return p.CmdException(ctx, in, out, seqId, err2) 190 } else { 191 result.Success = ret 192 } 193 return p.Cmd(ctx, in, out, &result, seqId) 194 } 195 196 type processorSetNXBytes struct { 197 processorBase 198 handler RedisProxy 199 } 200 201 func (p *processorSetNXBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 202 args := SetNXBytesArgs{} 203 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 204 return false, err 205 } 206 207 result := SetNXBytesResult{} 208 209 if ret, err2 := p.handler.SetNXBytes(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil { 210 return p.CmdException(ctx, in, out, seqId, err2) 211 } else { 212 result.Success = ret 213 } 214 return p.Cmd(ctx, in, out, &result, seqId) 215 } 216 217 type processorGet struct { 218 processorBase 219 handler RedisProxy 220 } 221 222 func (p *processorGet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 223 args := GetArgs{} 224 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 225 return false, err 226 } 227 228 result := GetResult{} 229 if ret, err2 := p.handler.Get(ctx, args.Appid, args.Key); err2 != nil { 230 return p.CmdException(ctx, in, out, seqId, err2) 231 } else { 232 result.Success = ret 233 } 234 return p.Cmd(ctx, in, out, &result, seqId) 235 } 236 237 type processorGetBytes struct { 238 processorBase 239 handler RedisProxy 240 } 241 242 func (p *processorGetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 243 args := GetBytesArgs{} 244 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 245 return false, err 246 } 247 248 result := GetBytesResult{} 249 if ret, err2 := p.handler.GetBytes(ctx, args.Appid, args.Key); err2 != nil { 250 return p.CmdException(ctx, in, out, seqId, err2) 251 } else { 252 result.Success = ret 253 } 254 return p.Cmd(ctx, in, out, &result, seqId) 255 } 256 257 type processorMSet struct { 258 processorBase 259 handler RedisProxy 260 } 261 262 func (p *processorMSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 263 args := MSetArgs{} 264 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 265 return false, err 266 } 267 268 result := MSetResult{} 269 if ret, err2 := p.handler.MSet(ctx, args.Appid, args.Reqs); err2 != nil { 270 return p.CmdException(ctx, in, out, seqId, err2) 271 } else { 272 result.Success = ret 273 } 274 return p.Cmd(ctx, in, out, &result, seqId) 275 } 276 277 type processorMSetBytes struct { 278 processorBase 279 handler RedisProxy 280 } 281 282 func (p *processorMSetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 283 args := RedisProxyMSetBytesArgs{} 284 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 285 return false, err 286 } 287 288 result := MSetBytesResult{} 289 if ret, err2 := p.handler.MSetBytes(ctx, args.Appid, args.Reqs); err2 != nil { 290 return p.CmdException(ctx, in, out, seqId, err2) 291 } else { 292 result.Success = ret 293 } 294 return p.Cmd(ctx, in, out, &result, seqId) 295 } 296 297 type processorMGet struct { 298 processorBase 299 handler RedisProxy 300 } 301 302 func (p *processorMGet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 303 args := MGetArgs{} 304 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 305 return false, err 306 } 307 308 result := MGetResult{} 309 if ret, err2 := p.handler.MGet(ctx, args.Appid, args.Keys); err2 != nil { 310 return p.CmdException(ctx, in, out, seqId, err2) 311 } else { 312 result.Success = ret 313 } 314 return p.Cmd(ctx, in, out, &result, seqId) 315 } 316 317 type processorMGetBytes struct { 318 processorBase 319 handler RedisProxy 320 } 321 322 func (p *processorMGetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 323 args := MGetBytesArgs{} 324 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 325 return false, err 326 } 327 328 result := MGetBytesResult{} 329 if ret, err2 := p.handler.MGetBytes(ctx, args.Appid, args.Keys); err2 != nil { 330 return p.CmdException(ctx, in, out, seqId, err2) 331 } else { 332 result.Success = ret 333 } 334 return p.Cmd(ctx, in, out, &result, seqId) 335 } 336 337 type processorDel struct { 338 processorBase 339 handler RedisProxy 340 } 341 342 func (p *processorDel) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 343 args := DelArgs{} 344 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 345 return false, err 346 } 347 348 result := DelResult{} 349 if ret, err2 := p.handler.Del(ctx, args.Appid, args.Key); err2 != nil { 350 return p.CmdException(ctx, in, out, seqId, err2) 351 } else { 352 result.Success = ret 353 } 354 return p.Cmd(ctx, in, out, &result, seqId) 355 } 356 357 type processorMDel struct { 358 processorBase 359 handler RedisProxy 360 } 361 362 func (p *processorMDel) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 363 args := MDelArgs{} 364 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 365 return false, err 366 } 367 368 result := MDelResult{} 369 if ret, err2 := p.handler.MDel(ctx, args.Appid, args.Keys); err2 != nil { 370 return p.CmdException(ctx, in, out, seqId, err2) 371 } else { 372 result.Success = ret 373 } 374 return p.Cmd(ctx, in, out, &result, seqId) 375 } 376 377 type processorKeys struct { 378 processorBase 379 handler RedisProxy 380 } 381 382 func (p *processorKeys) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 383 args := KeysArgs{} 384 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 385 return false, err 386 } 387 388 result := KeysResult{} 389 if ret, err2 := p.handler.Keys(ctx, args.Appid, args.Key); err2 != nil { 390 return p.CmdException(ctx, in, out, seqId, err2) 391 } else { 392 result.Success = ret 393 } 394 return p.Cmd(ctx, in, out, &result, seqId) 395 } 396 397 type processorExpire struct { 398 processorBase 399 handler RedisProxy 400 } 401 402 func (p *processorExpire) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 403 args := ExpireArgs{} 404 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 405 return false, err 406 } 407 408 result := ExpireResult{} 409 if ret, err2 := p.handler.Expire(ctx, args.Appid, args.Key, args.TTL); err2 != nil { 410 return p.CmdException(ctx, in, out, seqId, err2) 411 } else { 412 result.Success = ret 413 } 414 return p.Cmd(ctx, in, out, &result, seqId) 415 } 416 417 type processorTTL struct { 418 processorBase 419 handler RedisProxy 420 } 421 422 func (p *processorTTL) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 423 args := TtlArgs{} 424 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 425 return false, err 426 } 427 result := TtlResult{} 428 if ret, err2 := p.handler.TTL(ctx, args.Appid, args.Key); err2 != nil { 429 return p.CmdException(ctx, in, out, seqId, err2) 430 } else { 431 result.Success = ret 432 } 433 return p.Cmd(ctx, in, out, &result, seqId) 434 } 435 436 type processorExists struct { 437 processorBase 438 handler RedisProxy 439 } 440 441 func (p *processorExists) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 442 args := ExistsArgs{} 443 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 444 return false, err 445 } 446 result := ExistsResult{} 447 if ret, err2 := p.handler.Exists(ctx, args.Appid, args.Key); err2 != nil { 448 return p.CmdException(ctx, in, out, seqId, err2) 449 } else { 450 result.Success = ret 451 } 452 return p.Cmd(ctx, in, out, &result, seqId) 453 } 454 455 type processorHSet struct { 456 processorBase 457 handler RedisProxy 458 } 459 460 func (p *processorHSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 461 args := HSetArgs{} 462 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 463 return false, err 464 } 465 result := HSetResult{} 466 if ret, err2 := p.handler.HSet(ctx, args.Appid, args.Key, args.Field, args.Value); err2 != nil { 467 return p.CmdException(ctx, in, out, seqId, err2) 468 } else { 469 result.Success = ret 470 } 471 return p.Cmd(ctx, in, out, &result, seqId) 472 } 473 474 type processorHSetBytes struct { 475 processorBase 476 handler RedisProxy 477 } 478 479 func (p *processorHSetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 480 args := HSetBytesArgs{} 481 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 482 return false, err 483 } 484 result := HSetBytesResult{} 485 if ret, err2 := p.handler.HSetBytes(ctx, args.Appid, args.Key, args.Field, args.Value); err2 != nil { 486 return p.CmdException(ctx, in, out, seqId, err2) 487 } else { 488 result.Success = ret 489 } 490 return p.Cmd(ctx, in, out, &result, seqId) 491 } 492 493 type processorHSetNX struct { 494 processorBase 495 handler RedisProxy 496 } 497 498 func (p *processorHSetNX) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 499 args := HSetNXArgs{} 500 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 501 return false, err 502 } 503 result := HSetNXResult{} 504 if ret, err2 := p.handler.HSetNX(ctx, args.Appid, args.Key, args.Field, args.Value); err2 != nil { 505 return p.CmdException(ctx, in, out, seqId, err2) 506 } else { 507 result.Success = ret 508 } 509 return p.Cmd(ctx, in, out, &result, seqId) 510 } 511 512 type processorHSetNXBytes struct { 513 processorBase 514 handler RedisProxy 515 } 516 517 func (p *processorHSetNXBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 518 args := HSetNXBytesArgs{} 519 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 520 return false, err 521 } 522 result := HSetNXBytesResult{} 523 if ret, err2 := p.handler.HSetNXBytes(ctx, args.Appid, args.Key, args.Field, args.Value); err2 != nil { 524 return p.CmdException(ctx, in, out, seqId, err2) 525 } else { 526 result.Success = ret 527 } 528 return p.Cmd(ctx, in, out, &result, seqId) 529 } 530 531 type processorHGet struct { 532 processorBase 533 handler RedisProxy 534 } 535 536 func (p *processorHGet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 537 args := ProxyHGetArgs{} 538 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 539 return false, err 540 } 541 542 result := HGetResult{} 543 if ret, err2 := p.handler.HGet(ctx, args.Appid, args.Key, args.Field); err2 != nil { 544 return p.CmdException(ctx, in, out, seqId, err2) 545 } else { 546 result.Success = ret 547 } 548 return p.Cmd(ctx, in, out, &result, seqId) 549 } 550 551 type processorHGetBytes struct { 552 processorBase 553 handler RedisProxy 554 } 555 556 func (p *processorHGetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 557 args := RedisProxyHGetBytesArgs{} 558 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 559 return false, err 560 } 561 result := HGetBytesResult{} 562 if ret, err2 := p.handler.HGetBytes(ctx, args.Appid, args.Key, args.Field); err2 != nil { 563 return p.CmdException(ctx, in, out, seqId, err2) 564 } else { 565 result.Success = ret 566 } 567 return p.Cmd(ctx, in, out, &result, seqId) 568 } 569 570 type processorHMSet struct { 571 processorBase 572 handler RedisProxy 573 } 574 575 func (p *processorHMSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 576 args := HmSetArgs{} 577 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 578 return false, err 579 } 580 result := HmSetResult{} 581 if ret, err2 := p.handler.HMSet(ctx, args.Appid, args.Key, args.Fields); err2 != nil { 582 return p.CmdException(ctx, in, out, seqId, err2) 583 } else { 584 result.Success = ret 585 } 586 return p.Cmd(ctx, in, out, &result, seqId) 587 } 588 589 type processorHMSetBytes struct { 590 processorBase 591 handler RedisProxy 592 } 593 594 func (p *processorHMSetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 595 args := HmSetBytesArgs{} 596 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 597 return false, err 598 } 599 result := HmSetBytesResult{} 600 if ret, err2 := p.handler.HMSetBytes(ctx, args.Appid, args.Key, args.Fields); err2 != nil { 601 return p.CmdException(ctx, in, out, seqId, err2) 602 } else { 603 result.Success = ret 604 } 605 return p.Cmd(ctx, in, out, &result, seqId) 606 } 607 608 type processorHMGet struct { 609 processorBase 610 handler RedisProxy 611 } 612 613 func (p *processorHMGet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 614 args := HmGetArgs{} 615 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 616 return false, err 617 } 618 result := HMGetResult{} 619 if ret, err2 := p.handler.HMGet(ctx, args.Appid, args.Key, args.Fields); err2 != nil { 620 return p.CmdException(ctx, in, out, seqId, err2) 621 } else { 622 result.Success = ret 623 } 624 return p.Cmd(ctx, in, out, &result, seqId) 625 } 626 627 type processorHMGetBytes struct { 628 processorBase 629 handler RedisProxy 630 } 631 632 func (p *processorHMGetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 633 args := HMGetBytesArgs{} 634 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 635 return false, err 636 } 637 result := HMGetBytesResult{} 638 if ret, err2 := p.handler.HMGetBytes(ctx, args.Appid, args.Key, args.Fields); err2 != nil { 639 return p.CmdException(ctx, in, out, seqId, err2) 640 } else { 641 result.Success = ret 642 } 643 return p.Cmd(ctx, in, out, &result, seqId) 644 } 645 646 type processorHGetAll struct { 647 processorBase 648 handler RedisProxy 649 } 650 651 func (p *processorHGetAll) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 652 args := HGetAllArgs{} 653 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 654 return false, err 655 } 656 result := HGetAllResult{} 657 if ret, err2 := p.handler.HGetAll(ctx, args.Appid, args.Key); err2 != nil { 658 return p.CmdException(ctx, in, out, seqId, err2) 659 } else { 660 result.Success = ret 661 } 662 return p.Cmd(ctx, in, out, &result, seqId) 663 } 664 665 type processorHDel struct { 666 processorBase 667 handler RedisProxy 668 } 669 670 func (p *processorHDel) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 671 args := HDelArgs{} 672 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 673 return false, err 674 } 675 result := HDelResult{} 676 if ret, err2 := p.handler.HDel(ctx, args.Appid, args.Key, args.Field); err2 != nil { 677 return p.CmdException(ctx, in, out, seqId, err2) 678 } else { 679 result.Success = ret 680 } 681 return p.Cmd(ctx, in, out, &result, seqId) 682 } 683 684 type processorMHDel struct { 685 processorBase 686 handler RedisProxy 687 } 688 689 func (p *processorMHDel) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 690 args := MhDelArgs{} 691 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 692 return false, err 693 } 694 result := MhDelResult{} 695 if ret, err2 := p.handler.MHDel(ctx, args.Appid, args.Key, args.Fields); err2 != nil { 696 return p.CmdException(ctx, in, out, seqId, err2) 697 } else { 698 result.Success = ret 699 } 700 return p.Cmd(ctx, in, out, &result, seqId) 701 } 702 703 type processorHKeys struct { 704 processorBase 705 handler RedisProxy 706 } 707 708 func (p *processorHKeys) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 709 args := HKeysArgs{} 710 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 711 return false, err 712 } 713 result := HKeysResult{} 714 if ret, err2 := p.handler.HKeys(ctx, args.Appid, args.Key); err2 != nil { 715 return p.CmdException(ctx, in, out, seqId, err2) 716 } else { 717 result.Success = ret 718 } 719 return p.Cmd(ctx, in, out, &result, seqId) 720 } 721 722 type processorHVals struct { 723 processorBase 724 handler RedisProxy 725 } 726 727 func (p *processorHVals) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 728 args := HValuesArgs{} 729 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 730 return false, err 731 } 732 result := HValuesResult{} 733 if ret, err2 := p.handler.HVals(ctx, args.Appid, args.Key); err2 != nil { 734 return p.CmdException(ctx, in, out, seqId, err2) 735 } else { 736 result.Success = ret 737 } 738 return p.Cmd(ctx, in, out, &result, seqId) 739 } 740 741 type processorHIncrBy struct { 742 processorBase 743 handler RedisProxy 744 } 745 746 func (p *processorHIncrBy) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 747 args := HIncrByArgs{} 748 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 749 return false, err 750 } 751 result := HIncrByResult{} 752 if ret, err2 := p.handler.HIncrBy(ctx, args.Appid, args.Key, args.Field, args.Inrc); err2 != nil { 753 return p.CmdException(ctx, in, out, seqId, err2) 754 } else { 755 result.Success = ret 756 } 757 return p.Cmd(ctx, in, out, &result, seqId) 758 } 759 760 type processorHIncrByFloat struct { 761 processorBase 762 handler RedisProxy 763 } 764 765 func (p *processorHIncrByFloat) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 766 args := HIncrByFloatArgs{} 767 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 768 return false, err 769 } 770 result := HIncrByFloatResult{} 771 if ret, err2 := p.handler.HIncrByFloat(ctx, args.Appid, args.Key, args.Field, args.Inrc); err2 != nil { 772 return p.CmdException(ctx, in, out, seqId, err2) 773 } else { 774 result.Success = ret 775 } 776 return p.Cmd(ctx, in, out, &result, seqId) 777 } 778 779 type processorHExists struct { 780 processorBase 781 handler RedisProxy 782 } 783 784 func (p *processorHExists) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 785 args := HExistsArgs{} 786 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 787 return false, err 788 } 789 result := HExistsResult{} 790 if ret, err2 := p.handler.HExists(ctx, args.Appid, args.Key, args.Field); err2 != nil { 791 return p.CmdException(ctx, in, out, seqId, err2) 792 } else { 793 result.Success = ret 794 } 795 return p.Cmd(ctx, in, out, &result, seqId) 796 } 797 798 type processorZAdd struct { 799 processorBase 800 handler RedisProxy 801 } 802 803 func (p *processorZAdd) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 804 args := ZAddArgs{} 805 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 806 return false, err 807 } 808 result := ZAddResult{} 809 if ret, err2 := p.handler.ZAdd(ctx, args.Appid, args.Key, args.Member); err2 != nil { 810 return p.CmdException(ctx, in, out, seqId, err2) 811 } else { 812 result.Success = ret 813 } 814 return p.Cmd(ctx, in, out, &result, seqId) 815 } 816 817 type processorMZAdd struct { 818 processorBase 819 handler RedisProxy 820 } 821 822 func (p *processorMZAdd) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 823 args := MzAddArgs{} 824 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 825 return false, err 826 } 827 result := MzAddResult{} 828 if ret, err2 := p.handler.MZAdd(ctx, args.Appid, args.Key, args.Members); err2 != nil { 829 return p.CmdException(ctx, in, out, seqId, err2) 830 } else { 831 result.Success = ret 832 } 833 return p.Cmd(ctx, in, out, &result, seqId) 834 } 835 836 type processorZCard struct { 837 processorBase 838 handler RedisProxy 839 } 840 841 func (p *processorZCard) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 842 args := ZCardArgs{} 843 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 844 return false, err 845 } 846 result := ZCardResult{} 847 if ret, err2 := p.handler.ZCard(ctx, args.Appid, args.Key); err2 != nil { 848 return p.CmdException(ctx, in, out, seqId, err2) 849 } else { 850 result.Success = ret 851 } 852 return p.Cmd(ctx, in, out, &result, seqId) 853 } 854 855 type processorZCount struct { 856 processorBase 857 handler RedisProxy 858 } 859 860 func (p *processorZCount) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 861 args := ZCountArgs{} 862 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 863 return false, err 864 } 865 result := ZCountResult{} 866 if ret, err2 := p.handler.ZCount(ctx, args.Appid, args.Key, args.Min, args.Max); err2 != nil { 867 return p.CmdException(ctx, in, out, seqId, err2) 868 } else { 869 result.Success = ret 870 } 871 return p.Cmd(ctx, in, out, &result, seqId) 872 } 873 874 type processorZRangeWithScores struct { 875 processorBase 876 handler RedisProxy 877 } 878 879 func (p *processorZRangeWithScores) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 880 args := ZRangeWithScoresArgs{} 881 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 882 return false, err 883 } 884 result := ZRangeWithScoresResult{} 885 if ret, err2 := p.handler.ZRangeWithScores(ctx, args.Appid, args.Key, args.Start, args.Stop); err2 != nil { 886 return p.CmdException(ctx, in, out, seqId, err2) 887 } else { 888 result.Success = ret 889 } 890 return p.Cmd(ctx, in, out, &result, seqId) 891 } 892 893 type processorZRangeByScoreWithScores struct { 894 processorBase 895 handler RedisProxy 896 } 897 898 func (p *processorZRangeByScoreWithScores) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 899 args := ZRangeByScoreWithScoresArgs{} 900 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 901 return false, err 902 } 903 result := ZRangeByScoreWithScoresResult{} 904 if ret, err2 := p.handler.ZRangeByScoreWithScores(ctx, args.Appid, args.Key, args.Min, args.Max, args.Offset, args.Count); err2 != nil { 905 return p.CmdException(ctx, in, out, seqId, err2) 906 } else { 907 result.Success = ret 908 } 909 return p.Cmd(ctx, in, out, &result, seqId) 910 } 911 912 type processorZRem struct { 913 processorBase 914 handler RedisProxy 915 } 916 917 func (p *processorZRem) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 918 args := ZRemArgs{} 919 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 920 return false, err 921 } 922 result := ZRemResult{} 923 if ret, err2 := p.handler.ZRem(ctx, args.Appid, args.Key, args.Member); err2 != nil { 924 return p.CmdException(ctx, in, out, seqId, err2) 925 } else { 926 result.Success = ret 927 } 928 return p.Cmd(ctx, in, out, &result, seqId) 929 } 930 931 type processorMZRem struct { 932 processorBase 933 handler RedisProxy 934 } 935 936 func (p *processorMZRem) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 937 args := MzRemArgs{} 938 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 939 return false, err 940 } 941 result := MzRemResult{} 942 if ret, err2 := p.handler.MZRem(ctx, args.Appid, args.Key, args.Members); err2 != nil { 943 return p.CmdException(ctx, in, out, seqId, err2) 944 } else { 945 result.Success = ret 946 } 947 return p.Cmd(ctx, in, out, &result, seqId) 948 } 949 950 type processorZRemRangeByRank struct { 951 processorBase 952 handler RedisProxy 953 } 954 955 func (p *processorZRemRangeByRank) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 956 args := ZRemRangeByRankArgs{} 957 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 958 return false, err 959 } 960 result := ZRemRangeByRankResult{} 961 if ret, err2 := p.handler.ZRemRangeByRank(ctx, args.Appid, args.Key, args.Start, args.Stop); err2 != nil { 962 return p.CmdException(ctx, in, out, seqId, err2) 963 } else { 964 result.Success = ret 965 } 966 return p.Cmd(ctx, in, out, &result, seqId) 967 } 968 969 type processorZRemRangeByScore struct { 970 processorBase 971 handler RedisProxy 972 } 973 974 func (p *processorZRemRangeByScore) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 975 args := ZRemRangeByScoreArgs{} 976 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 977 return false, err 978 } 979 result := ZRemRangeByScoreResult{} 980 if ret, err2 := p.handler.ZRemRangeByScore(ctx, args.Appid, args.Key, args.Min, args.Max); err2 != nil { 981 return p.CmdException(ctx, in, out, seqId, err2) 982 } else { 983 result.Success = ret 984 } 985 return p.Cmd(ctx, in, out, &result, seqId) 986 } 987 988 type processorZIncrBy struct { 989 processorBase 990 handler RedisProxy 991 } 992 993 func (p *processorZIncrBy) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 994 args := ZIncrByArgs{} 995 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 996 return false, err 997 } 998 result := ZIncrByResult{} 999 if ret, err2 := p.handler.ZIncrBy(ctx, args.Appid, args.Key, args.Increment, args.Member); err2 != nil { 1000 return p.CmdException(ctx, in, out, seqId, err2) 1001 } else { 1002 result.Success = ret 1003 } 1004 return p.Cmd(ctx, in, out, &result, seqId) 1005 } 1006 1007 type processorZScore struct { 1008 processorBase 1009 handler RedisProxy 1010 } 1011 1012 func (p *processorZScore) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1013 args := ZScoreArgs{} 1014 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1015 return false, err 1016 } 1017 result := ZScoreResult{} 1018 if ret, err2 := p.handler.ZScore(ctx, args.Appid, args.Key, args.Member); err2 != nil { 1019 return p.CmdException(ctx, in, out, seqId, err2) 1020 } else { 1021 result.Success = ret 1022 } 1023 return p.Cmd(ctx, in, out, &result, seqId) 1024 } 1025 1026 type processorSAdd struct { 1027 processorBase 1028 handler RedisProxy 1029 } 1030 1031 func (p *processorSAdd) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1032 args := SAddArgs{} 1033 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1034 return false, err 1035 } 1036 result := SAddResult{} 1037 if ret, err2 := p.handler.SAdd(ctx, args.Appid, args.Key, args.Member); err2 != nil { 1038 return p.CmdException(ctx, in, out, seqId, err2) 1039 } else { 1040 result.Success = ret 1041 } 1042 return p.Cmd(ctx, in, out, &result, seqId) 1043 } 1044 1045 type processorMSAdd struct { 1046 processorBase 1047 handler RedisProxy 1048 } 1049 1050 func (p *processorMSAdd) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1051 1052 args := MsAddArgs{} 1053 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1054 return false, err 1055 } 1056 result := MsAddResult{} 1057 if ret, err2 := p.handler.MSAdd(ctx, args.Appid, args.Key, args.Members); err2 != nil { 1058 return p.CmdException(ctx, in, out, seqId, err2) 1059 } else { 1060 result.Success = ret 1061 } 1062 return p.Cmd(ctx, in, out, &result, seqId) 1063 } 1064 1065 type processorSCard struct { 1066 processorBase 1067 handler RedisProxy 1068 } 1069 1070 func (p *processorSCard) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1071 args := SCardArgs{} 1072 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1073 return false, err 1074 } 1075 result := SCardResult{} 1076 if ret, err2 := p.handler.SCard(ctx, args.Appid, args.Key); err2 != nil { 1077 return p.CmdException(ctx, in, out, seqId, err2) 1078 } else { 1079 result.Success = ret 1080 } 1081 return p.Cmd(ctx, in, out, &result, seqId) 1082 } 1083 1084 type processorSIsMember struct { 1085 processorBase 1086 handler RedisProxy 1087 } 1088 1089 func (p *processorSIsMember) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1090 args := SIsMemberArgs{} 1091 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1092 return false, err 1093 } 1094 result := SIsMemberResult{} 1095 if ret, err2 := p.handler.SIsMember(ctx, args.Appid, args.Key, args.Member); err2 != nil { 1096 return p.CmdException(ctx, in, out, seqId, err2) 1097 } else { 1098 result.Success = ret 1099 } 1100 return p.Cmd(ctx, in, out, &result, seqId) 1101 } 1102 1103 type processorSMembers struct { 1104 processorBase 1105 handler RedisProxy 1106 } 1107 1108 func (p *processorSMembers) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1109 args := SMembersArgs{} 1110 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1111 return false, err 1112 } 1113 result := SMembersResult{} 1114 if ret, err2 := p.handler.SMembers(ctx, args.Appid, args.Key); err2 != nil { 1115 return p.CmdException(ctx, in, out, seqId, err2) 1116 } else { 1117 result.Success = ret 1118 } 1119 return p.Cmd(ctx, in, out, &result, seqId) 1120 } 1121 1122 type processorSRandMember struct { 1123 processorBase 1124 handler RedisProxy 1125 } 1126 1127 func (p *processorSRandMember) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1128 args := SRandMemberArgs{} 1129 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1130 return false, err 1131 } 1132 result := SRandMemberResult{} 1133 if ret, err2 := p.handler.SRandMember(ctx, args.Appid, args.Key); err2 != nil { 1134 return p.CmdException(ctx, in, out, seqId, err2) 1135 } else { 1136 result.Success = ret 1137 } 1138 return p.Cmd(ctx, in, out, &result, seqId) 1139 } 1140 1141 type processorSRandMemberN struct { 1142 processorBase 1143 handler RedisProxy 1144 } 1145 1146 func (p *processorSRandMemberN) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1147 args := SRandMemberNArgs{} 1148 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1149 return false, err 1150 } 1151 result := SRandMemberNResult{} 1152 if ret, err2 := p.handler.SRandMemberN(ctx, args.Appid, args.Key, args.N); err2 != nil { 1153 return p.CmdException(ctx, in, out, seqId, err2) 1154 } else { 1155 result.Success = ret 1156 } 1157 return p.Cmd(ctx, in, out, &result, seqId) 1158 } 1159 1160 type processorSRem struct { 1161 processorBase 1162 handler RedisProxy 1163 } 1164 1165 func (p *processorSRem) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1166 args := SRemArgs{} 1167 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1168 return false, err 1169 } 1170 result := SRemResult{} 1171 if ret, err2 := p.handler.SRem(ctx, args.Appid, args.Key, args.Member); err2 != nil { 1172 return p.CmdException(ctx, in, out, seqId, err2) 1173 } else { 1174 result.Success = ret 1175 } 1176 return p.Cmd(ctx, in, out, &result, seqId) 1177 } 1178 1179 type processorMSRem struct { 1180 processorBase 1181 handler RedisProxy 1182 } 1183 1184 func (p *processorMSRem) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1185 args := MsRemArgs{} 1186 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1187 return false, err 1188 } 1189 result := MsRemResult{} 1190 if ret, err2 := p.handler.MSRem(ctx, args.Appid, args.Key, args.Member); err2 != nil { 1191 return p.CmdException(ctx, in, out, seqId, err2) 1192 } else { 1193 result.Success = ret 1194 } 1195 return p.Cmd(ctx, in, out, &result, seqId) 1196 } 1197 1198 type processorLPush struct { 1199 processorBase 1200 handler RedisProxy 1201 } 1202 1203 func (p *processorLPush) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1204 args := LPushArgs{} 1205 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1206 return false, err 1207 } 1208 result := LPushResult{} 1209 if ret, err2 := p.handler.LPush(ctx, args.Appid, args.Key, args.Value); err2 != nil { 1210 return p.CmdException(ctx, in, out, seqId, err2) 1211 } else { 1212 result.Success = ret 1213 } 1214 return p.Cmd(ctx, in, out, &result, seqId) 1215 } 1216 1217 type processorLPushByte struct { 1218 processorBase 1219 handler RedisProxy 1220 } 1221 1222 func (p *processorLPushByte) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1223 args := LPushByteArgs{} 1224 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1225 return false, err 1226 } 1227 result := LPushByteResult{} 1228 if ret, err2 := p.handler.LPushByte(ctx, args.Appid, args.Key, args.Value); err2 != nil { 1229 return p.CmdException(ctx, in, out, seqId, err2) 1230 } else { 1231 result.Success = ret 1232 } 1233 return p.Cmd(ctx, in, out, &result, seqId) 1234 } 1235 1236 type processorRPush struct { 1237 processorBase 1238 handler RedisProxy 1239 } 1240 1241 func (p *processorRPush) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1242 args := RPushArgs{} 1243 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1244 return false, err 1245 } 1246 result := RPushResult{} 1247 if ret, err2 := p.handler.RPush(ctx, args.Appid, args.Key, args.Value); err2 != nil { 1248 return p.CmdException(ctx, in, out, seqId, err2) 1249 } else { 1250 result.Success = ret 1251 } 1252 return p.Cmd(ctx, in, out, &result, seqId) 1253 } 1254 1255 type processorRPushByte struct { 1256 processorBase 1257 handler RedisProxy 1258 } 1259 1260 func (p *processorRPushByte) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1261 args := RPushByteArgs{} 1262 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1263 return false, err 1264 } 1265 result := RPushByteResult{} 1266 if ret, err2 := p.handler.RPushByte(ctx, args.Appid, args.Key, args.Value); err2 != nil { 1267 return p.CmdException(ctx, in, out, seqId, err2) 1268 } else { 1269 result.Success = ret 1270 } 1271 return p.Cmd(ctx, in, out, &result, seqId) 1272 } 1273 1274 type processorMLPush struct { 1275 processorBase 1276 handler RedisProxy 1277 } 1278 1279 func (p *processorMLPush) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1280 args := MlPushArgs{} 1281 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1282 return false, err 1283 } 1284 result := MlPushResult{} 1285 if ret, err2 := p.handler.MLPush(ctx, args.Appid, args.Key, args.Value); err2 != nil { 1286 return p.CmdException(ctx, in, out, seqId, err2) 1287 } else { 1288 result.Success = ret 1289 } 1290 return p.Cmd(ctx, in, out, &result, seqId) 1291 } 1292 1293 type processorMLPushWithTTL struct { 1294 processorBase 1295 handler RedisProxy 1296 } 1297 1298 func (p *processorMLPushWithTTL) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1299 args := MlPushWithTTLArgs{} 1300 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1301 return false, err 1302 } 1303 result := MlPushWithTTLResult{} 1304 if ret, err2 := p.handler.MLPushWithTTL(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil { 1305 return p.CmdException(ctx, in, out, seqId, err2) 1306 } else { 1307 result.Success = ret 1308 } 1309 return p.Cmd(ctx, in, out, &result, seqId) 1310 } 1311 1312 type processorMLPushByteWithTTL struct { 1313 processorBase 1314 handler RedisProxy 1315 } 1316 1317 func (p *processorMLPushByteWithTTL) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1318 args := MlPushByteWithTTLArgs{} 1319 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1320 return false, err 1321 } 1322 result := MlPushByteWithTTLResult{} 1323 if ret, err2 := p.handler.MLPushByteWithTTL(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil { 1324 return p.CmdException(ctx, in, out, seqId, err2) 1325 } else { 1326 result.Success = ret 1327 } 1328 return p.Cmd(ctx, in, out, &result, seqId) 1329 } 1330 1331 type processorMRPushWithTTL struct { 1332 processorBase 1333 handler RedisProxy 1334 } 1335 1336 func (p *processorMRPushWithTTL) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1337 args := MrPushWithTTLArgs{} 1338 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1339 return false, err 1340 } 1341 result := MrPushWithTTLResult{} 1342 if ret, err2 := p.handler.MRPushWithTTL(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil { 1343 return p.CmdException(ctx, in, out, seqId, err2) 1344 } else { 1345 result.Success = ret 1346 } 1347 return p.Cmd(ctx, in, out, &result, seqId) 1348 } 1349 1350 type processorMRPushByteWithTTL struct { 1351 processorBase 1352 handler RedisProxy 1353 } 1354 1355 func (p *processorMRPushByteWithTTL) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1356 args := MrPushByteWithTTLArgs{} 1357 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1358 return false, err 1359 } 1360 result := MrPushByteWithTTLResult{} 1361 if ret, err2 := p.handler.MRPushByteWithTTL(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil { 1362 return p.CmdException(ctx, in, out, seqId, err2) 1363 } else { 1364 result.Success = ret 1365 } 1366 return p.Cmd(ctx, in, out, &result, seqId) 1367 } 1368 1369 type processorLPop struct { 1370 processorBase 1371 handler RedisProxy 1372 } 1373 1374 func (p *processorLPop) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1375 args := ProxyLPopArgs{} 1376 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1377 return false, err 1378 } 1379 result := LPopResult{} 1380 if ret, err2 := p.handler.LPop(ctx, args.Appid, args.Key); err2 != nil { 1381 return p.CmdException(ctx, in, out, seqId, err2) 1382 } else { 1383 result.Success = ret 1384 } 1385 return p.Cmd(ctx, in, out, &result, seqId) 1386 } 1387 1388 type processorLPopByte struct { 1389 processorBase 1390 handler RedisProxy 1391 } 1392 1393 func (p *processorLPopByte) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1394 args := LPopByteArgs{} 1395 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1396 return false, err 1397 } 1398 result := LPopByteResult{} 1399 if ret, err2 := p.handler.LPopByte(ctx, args.Appid, args.Key); err2 != nil { 1400 return p.CmdException(ctx, in, out, seqId, err2) 1401 } else { 1402 result.Success = ret 1403 } 1404 return p.Cmd(ctx, in, out, &result, seqId) 1405 } 1406 1407 type processorRPop struct { 1408 processorBase 1409 handler RedisProxy 1410 } 1411 1412 func (p *processorRPop) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1413 args := RPopArgs{} 1414 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1415 return false, err 1416 } 1417 result := RPopResult{} 1418 if ret, err2 := p.handler.RPop(ctx, args.Appid, args.Key); err2 != nil { 1419 return p.CmdException(ctx, in, out, seqId, err2) 1420 } else { 1421 result.Success = ret 1422 } 1423 return p.Cmd(ctx, in, out, &result, seqId) 1424 } 1425 1426 type processorRPopByte struct { 1427 processorBase 1428 handler RedisProxy 1429 } 1430 1431 func (p *processorRPopByte) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1432 args := RPopByteArgs{} 1433 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1434 return false, err 1435 } 1436 result := RPopByteResult{} 1437 if ret, err2 := p.handler.RPopByte(ctx, args.Appid, args.Key); err2 != nil { 1438 return p.CmdException(ctx, in, out, seqId, err2) 1439 } else { 1440 result.Success = ret 1441 } 1442 return p.Cmd(ctx, in, out, &result, seqId) 1443 } 1444 1445 type processorLInsertBefore struct { 1446 processorBase 1447 handler RedisProxy 1448 } 1449 1450 func (p *processorLInsertBefore) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1451 args := LInsertBeforeArgs{} 1452 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1453 return false, err 1454 } 1455 result := LInsertBeforeResult{} 1456 if ret, err2 := p.handler.LInsertBefore(ctx, args.Appid, args.Key, args.Pivot, args.Value); err2 != nil { 1457 return p.CmdException(ctx, in, out, seqId, err2) 1458 } else { 1459 result.Success = ret 1460 } 1461 return p.Cmd(ctx, in, out, &result, seqId) 1462 } 1463 1464 type processorLInsertAfter struct { 1465 processorBase 1466 handler RedisProxy 1467 } 1468 1469 func (p *processorLInsertAfter) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1470 args := LInsertAfterArgs{} 1471 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1472 return false, err 1473 } 1474 result := LInsertAfterResult{} 1475 if ret, err2 := p.handler.LInsertAfter(ctx, args.Appid, args.Key, args.Pivot, args.Value); err2 != nil { 1476 return p.CmdException(ctx, in, out, seqId, err2) 1477 } else { 1478 result.Success = ret 1479 } 1480 return p.Cmd(ctx, in, out, &result, seqId) 1481 } 1482 1483 type processorLLen struct { 1484 processorBase 1485 handler RedisProxy 1486 } 1487 1488 func (p *processorLLen) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1489 args := LLenArgs{} 1490 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1491 return false, err 1492 } 1493 result := LLenResult{} 1494 if ret, err2 := p.handler.LLen(ctx, args.Appid, args.Key); err2 != nil { 1495 return p.CmdException(ctx, in, out, seqId, err2) 1496 } else { 1497 result.Success = ret 1498 } 1499 return p.Cmd(ctx, in, out, &result, seqId) 1500 } 1501 1502 type processorMLLen struct { 1503 processorBase 1504 handler RedisProxy 1505 } 1506 1507 func (p *processorMLLen) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1508 args := MlLenArgs{} 1509 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1510 return false, err 1511 } 1512 result := MlLenResult{} 1513 if ret, err2 := p.handler.MLLen(ctx, args.Appid, args.Keys); err2 != nil { 1514 return p.CmdException(ctx, in, out, seqId, err2) 1515 } else { 1516 result.Success = ret 1517 } 1518 return p.Cmd(ctx, in, out, &result, seqId) 1519 } 1520 1521 type processorLSet struct { 1522 processorBase 1523 handler RedisProxy 1524 } 1525 1526 func (p *processorLSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1527 args := LSetArgs{} 1528 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1529 return false, err 1530 } 1531 result := LSetResult{} 1532 if ret, err2 := p.handler.LSet(ctx, args.Appid, args.Key, args.Index, args.Value); err2 != nil { 1533 return p.CmdException(ctx, in, out, seqId, err2) 1534 } else { 1535 result.Success = ret 1536 } 1537 return p.Cmd(ctx, in, out, &result, seqId) 1538 } 1539 1540 type processorLIndex struct { 1541 processorBase 1542 handler RedisProxy 1543 } 1544 1545 func (p *processorLIndex) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1546 args := LIndexArgs{} 1547 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1548 return false, err 1549 } 1550 result := LIndexResult{} 1551 if ret, err2 := p.handler.LIndex(ctx, args.Appid, args.Key, args.Index); err2 != nil { 1552 return p.CmdException(ctx, in, out, seqId, err2) 1553 } else { 1554 result.Success = ret 1555 } 1556 return p.Cmd(ctx, in, out, &result, seqId) 1557 } 1558 1559 type processorLRange struct { 1560 processorBase 1561 handler RedisProxy 1562 } 1563 1564 func (p *processorLRange) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1565 args := LRangeArgs{} 1566 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1567 return false, err 1568 } 1569 result := LRangeResult{} 1570 if ret, err2 := p.handler.LRange(ctx, args.Appid, args.Key, args.Start, args.Stop); err2 != nil { 1571 return p.CmdException(ctx, in, out, seqId, err2) 1572 } else { 1573 result.Success = ret 1574 } 1575 return p.Cmd(ctx, in, out, &result, seqId) 1576 } 1577 1578 type processorLTrim struct { 1579 processorBase 1580 handler RedisProxy 1581 } 1582 1583 func (p *processorLTrim) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1584 args := LTrimArgs{} 1585 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1586 return false, err 1587 } 1588 result := LTrimResult{} 1589 if ret, err2 := p.handler.LTrim(ctx, args.Appid, args.Key, args.Start, args.Stop); err2 != nil { 1590 return p.CmdException(ctx, in, out, seqId, err2) 1591 } else { 1592 result.Success = ret 1593 } 1594 return p.Cmd(ctx, in, out, &result, seqId) 1595 } 1596 1597 type processorClusterNodes struct { 1598 processorBase 1599 handler RedisProxy 1600 } 1601 1602 func (p *processorClusterNodes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1603 args := ClusterNodesArgs{} 1604 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1605 return false, err 1606 } 1607 result := ClusterNodesResult{} 1608 if ret, err2 := p.handler.ClusterNodes(ctx, args.Appid); err2 != nil { 1609 return p.CmdException(ctx, in, out, seqId, err2) 1610 } else { 1611 result.Success = ret 1612 } 1613 return p.Cmd(ctx, in, out, &result, seqId) 1614 } 1615 1616 type processorClusterInfo struct { 1617 processorBase 1618 handler RedisProxy 1619 } 1620 1621 func (p *processorClusterInfo) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1622 args := ClusterInfoArgs{} 1623 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1624 return false, err 1625 } 1626 result := ClusterInfoResult{} 1627 if ret, err2 := p.handler.ClusterInfo(ctx, args.Appid); err2 != nil { 1628 return p.CmdException(ctx, in, out, seqId, err2) 1629 } else { 1630 result.Success = ret 1631 } 1632 return p.Cmd(ctx, in, out, &result, seqId) 1633 } 1634 1635 type processorInfo struct { 1636 processorBase 1637 handler RedisProxy 1638 } 1639 1640 func (p *processorInfo) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1641 args := InfoArgs{} 1642 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1643 return false, err 1644 } 1645 result := InfoResult{} 1646 if ret, err2 := p.handler.Info(ctx, args.Appid, args.Sections); err2 != nil { 1647 return p.CmdException(ctx, in, out, seqId, err2) 1648 } else { 1649 result.Success = ret 1650 } 1651 return p.Cmd(ctx, in, out, &result, seqId) 1652 } 1653 1654 type processorNodeInfo struct { 1655 processorBase 1656 handler RedisProxy 1657 } 1658 1659 func (p *processorNodeInfo) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) { 1660 args := NodeInfoArgs{} 1661 if _, err := p.Read(ctx, in, out, &args, seqId); err != nil { 1662 return false, err 1663 } 1664 result := NodeInfoResult{} 1665 if ret, err2 := p.handler.NodeInfo(ctx, args.Appid, args.Addr, args.Sections); err2 != nil { 1666 return p.CmdException(ctx, in, out, seqId, err2) 1667 } else { 1668 result.Success = ret 1669 } 1670 return p.Cmd(ctx, in, out, &result, seqId) 1671 }