1 Star 0 Fork 0

h79/goutils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
redis_processor.go 48.07 KB
一键复制 编辑 原始数据 按行查看 历史
huqiuyun 提交于 2022-06-01 16:22 . init
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671
package redis_proxy
import (
"context"
"github.com/apache/thrift/lib/go/thrift"
)
type processorBase struct {
cmd string
}
func (p *processorBase) Read(ctx context.Context, in, out thrift.TProtocol, args thrift.TStruct, seqId int32) (success bool, err thrift.TException) {
var err2 error
if err2 = args.Read(ctx, in); err2 != nil {
in.ReadMessageEnd(ctx)
exc := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
in.WriteMessageBegin(ctx, p.cmd, thrift.EXCEPTION, seqId)
exc.Write(ctx, in)
in.WriteMessageEnd(ctx)
in.Flush(ctx)
return false, thrift.WrapTException(err2)
}
in.ReadMessageEnd(ctx)
return true, nil
}
func (p *processorBase) CmdException(ctx context.Context, in, out thrift.TProtocol, seqId int32, err2 error) (success bool, err thrift.TException) {
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing "+p.cmd+": "+err2.Error())
in.WriteMessageBegin(ctx, p.cmd, thrift.EXCEPTION, seqId)
x.Write(ctx, in)
in.WriteMessageEnd(ctx)
in.Flush(ctx)
return false, thrift.WrapTException(err2)
}
func (p *processorBase) Cmd(ctx context.Context, in, out thrift.TProtocol, result thrift.TStruct, seqId int32) (success bool, err thrift.TException) {
var err2 error
if err2 = in.WriteMessageBegin(ctx, p.cmd, thrift.REPLY, seqId); err2 != nil {
err = thrift.WrapTException(err2)
}
if err2 = result.Write(ctx, in); err == nil && err2 != nil {
err = thrift.WrapTException(err2)
}
if err2 = in.WriteMessageEnd(ctx); err == nil && err2 != nil {
err = thrift.WrapTException(err2)
}
if err2 = in.Flush(ctx); err == nil && err2 != nil {
err = thrift.WrapTException(err2)
}
if err != nil {
return
}
return true, err
}
type processorPing struct {
processorBase
handler RedisProxy
}
func (p *processorPing) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := PingArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := PingResult{}
if ret, err2 := p.handler.Ping(ctx, args.Echo); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = &ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorRedisProxyPing struct {
processorBase
handler RedisProxy
}
func (p *processorRedisProxyPing) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := RedisProxyPingArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := RedisProxyPingResult{}
if ret, err2 := p.handler.Ping(ctx, args.Echo); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = &ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorGetSet struct {
processorBase
handler RedisProxy
}
func (p *processorGetSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := GetSetArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := GetSetResult{}
if ret, err2 := p.handler.GetSet(ctx, args.Appid, args.Key, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorGetSetBytes struct {
processorBase
handler RedisProxy
}
func (p *processorGetSetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := GetSetBytesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := GetSetBytesResult{}
if ret, err2 := p.handler.GetSetBytes(ctx, args.Appid, args.Key, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorSet struct {
processorBase
handler RedisProxy
}
func (p *processorSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := SetArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := SetResult{}
if ret, err2 := p.handler.Set(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorSetBytes struct {
processorBase
handler RedisProxy
}
func (p *processorSetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := SetBytesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := RedisProxySetBytesResult{}
if ret, err2 := p.handler.SetBytes(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorSetNX struct {
processorBase
handler RedisProxy
}
func (p *processorSetNX) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := SetNXArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := SetNXResult{}
if ret, err2 := p.handler.SetNX(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorSetNXBytes struct {
processorBase
handler RedisProxy
}
func (p *processorSetNXBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := SetNXBytesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := SetNXBytesResult{}
if ret, err2 := p.handler.SetNXBytes(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorGet struct {
processorBase
handler RedisProxy
}
func (p *processorGet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := GetArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := GetResult{}
if ret, err2 := p.handler.Get(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorGetBytes struct {
processorBase
handler RedisProxy
}
func (p *processorGetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := GetBytesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := GetBytesResult{}
if ret, err2 := p.handler.GetBytes(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMSet struct {
processorBase
handler RedisProxy
}
func (p *processorMSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MSetArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MSetResult{}
if ret, err2 := p.handler.MSet(ctx, args.Appid, args.Reqs); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMSetBytes struct {
processorBase
handler RedisProxy
}
func (p *processorMSetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := RedisProxyMSetBytesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MSetBytesResult{}
if ret, err2 := p.handler.MSetBytes(ctx, args.Appid, args.Reqs); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMGet struct {
processorBase
handler RedisProxy
}
func (p *processorMGet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MGetArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MGetResult{}
if ret, err2 := p.handler.MGet(ctx, args.Appid, args.Keys); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMGetBytes struct {
processorBase
handler RedisProxy
}
func (p *processorMGetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MGetBytesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MGetBytesResult{}
if ret, err2 := p.handler.MGetBytes(ctx, args.Appid, args.Keys); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorDel struct {
processorBase
handler RedisProxy
}
func (p *processorDel) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := DelArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := DelResult{}
if ret, err2 := p.handler.Del(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMDel struct {
processorBase
handler RedisProxy
}
func (p *processorMDel) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MDelArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MDelResult{}
if ret, err2 := p.handler.MDel(ctx, args.Appid, args.Keys); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorKeys struct {
processorBase
handler RedisProxy
}
func (p *processorKeys) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := KeysArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := KeysResult{}
if ret, err2 := p.handler.Keys(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorExpire struct {
processorBase
handler RedisProxy
}
func (p *processorExpire) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ExpireArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ExpireResult{}
if ret, err2 := p.handler.Expire(ctx, args.Appid, args.Key, args.TTL); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorTTL struct {
processorBase
handler RedisProxy
}
func (p *processorTTL) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := TtlArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := TtlResult{}
if ret, err2 := p.handler.TTL(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorExists struct {
processorBase
handler RedisProxy
}
func (p *processorExists) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ExistsArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ExistsResult{}
if ret, err2 := p.handler.Exists(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHSet struct {
processorBase
handler RedisProxy
}
func (p *processorHSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HSetArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HSetResult{}
if ret, err2 := p.handler.HSet(ctx, args.Appid, args.Key, args.Field, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHSetBytes struct {
processorBase
handler RedisProxy
}
func (p *processorHSetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HSetBytesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HSetBytesResult{}
if ret, err2 := p.handler.HSetBytes(ctx, args.Appid, args.Key, args.Field, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHSetNX struct {
processorBase
handler RedisProxy
}
func (p *processorHSetNX) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HSetNXArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HSetNXResult{}
if ret, err2 := p.handler.HSetNX(ctx, args.Appid, args.Key, args.Field, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHSetNXBytes struct {
processorBase
handler RedisProxy
}
func (p *processorHSetNXBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HSetNXBytesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HSetNXBytesResult{}
if ret, err2 := p.handler.HSetNXBytes(ctx, args.Appid, args.Key, args.Field, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHGet struct {
processorBase
handler RedisProxy
}
func (p *processorHGet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ProxyHGetArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HGetResult{}
if ret, err2 := p.handler.HGet(ctx, args.Appid, args.Key, args.Field); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHGetBytes struct {
processorBase
handler RedisProxy
}
func (p *processorHGetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := RedisProxyHGetBytesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HGetBytesResult{}
if ret, err2 := p.handler.HGetBytes(ctx, args.Appid, args.Key, args.Field); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHMSet struct {
processorBase
handler RedisProxy
}
func (p *processorHMSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HmSetArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HmSetResult{}
if ret, err2 := p.handler.HMSet(ctx, args.Appid, args.Key, args.Fields); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHMSetBytes struct {
processorBase
handler RedisProxy
}
func (p *processorHMSetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HmSetBytesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HmSetBytesResult{}
if ret, err2 := p.handler.HMSetBytes(ctx, args.Appid, args.Key, args.Fields); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHMGet struct {
processorBase
handler RedisProxy
}
func (p *processorHMGet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HmGetArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HMGetResult{}
if ret, err2 := p.handler.HMGet(ctx, args.Appid, args.Key, args.Fields); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHMGetBytes struct {
processorBase
handler RedisProxy
}
func (p *processorHMGetBytes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HMGetBytesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HMGetBytesResult{}
if ret, err2 := p.handler.HMGetBytes(ctx, args.Appid, args.Key, args.Fields); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHGetAll struct {
processorBase
handler RedisProxy
}
func (p *processorHGetAll) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HGetAllArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HGetAllResult{}
if ret, err2 := p.handler.HGetAll(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHDel struct {
processorBase
handler RedisProxy
}
func (p *processorHDel) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HDelArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HDelResult{}
if ret, err2 := p.handler.HDel(ctx, args.Appid, args.Key, args.Field); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMHDel struct {
processorBase
handler RedisProxy
}
func (p *processorMHDel) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MhDelArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MhDelResult{}
if ret, err2 := p.handler.MHDel(ctx, args.Appid, args.Key, args.Fields); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHKeys struct {
processorBase
handler RedisProxy
}
func (p *processorHKeys) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HKeysArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HKeysResult{}
if ret, err2 := p.handler.HKeys(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHVals struct {
processorBase
handler RedisProxy
}
func (p *processorHVals) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HValuesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HValuesResult{}
if ret, err2 := p.handler.HVals(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHIncrBy struct {
processorBase
handler RedisProxy
}
func (p *processorHIncrBy) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HIncrByArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HIncrByResult{}
if ret, err2 := p.handler.HIncrBy(ctx, args.Appid, args.Key, args.Field, args.Inrc); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHIncrByFloat struct {
processorBase
handler RedisProxy
}
func (p *processorHIncrByFloat) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HIncrByFloatArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HIncrByFloatResult{}
if ret, err2 := p.handler.HIncrByFloat(ctx, args.Appid, args.Key, args.Field, args.Inrc); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorHExists struct {
processorBase
handler RedisProxy
}
func (p *processorHExists) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := HExistsArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := HExistsResult{}
if ret, err2 := p.handler.HExists(ctx, args.Appid, args.Key, args.Field); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorZAdd struct {
processorBase
handler RedisProxy
}
func (p *processorZAdd) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ZAddArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ZAddResult{}
if ret, err2 := p.handler.ZAdd(ctx, args.Appid, args.Key, args.Member); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMZAdd struct {
processorBase
handler RedisProxy
}
func (p *processorMZAdd) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MzAddArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MzAddResult{}
if ret, err2 := p.handler.MZAdd(ctx, args.Appid, args.Key, args.Members); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorZCard struct {
processorBase
handler RedisProxy
}
func (p *processorZCard) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ZCardArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ZCardResult{}
if ret, err2 := p.handler.ZCard(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorZCount struct {
processorBase
handler RedisProxy
}
func (p *processorZCount) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ZCountArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ZCountResult{}
if ret, err2 := p.handler.ZCount(ctx, args.Appid, args.Key, args.Min, args.Max); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorZRangeWithScores struct {
processorBase
handler RedisProxy
}
func (p *processorZRangeWithScores) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ZRangeWithScoresArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ZRangeWithScoresResult{}
if ret, err2 := p.handler.ZRangeWithScores(ctx, args.Appid, args.Key, args.Start, args.Stop); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorZRangeByScoreWithScores struct {
processorBase
handler RedisProxy
}
func (p *processorZRangeByScoreWithScores) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ZRangeByScoreWithScoresArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ZRangeByScoreWithScoresResult{}
if ret, err2 := p.handler.ZRangeByScoreWithScores(ctx, args.Appid, args.Key, args.Min, args.Max, args.Offset, args.Count); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorZRem struct {
processorBase
handler RedisProxy
}
func (p *processorZRem) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ZRemArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ZRemResult{}
if ret, err2 := p.handler.ZRem(ctx, args.Appid, args.Key, args.Member); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMZRem struct {
processorBase
handler RedisProxy
}
func (p *processorMZRem) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MzRemArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MzRemResult{}
if ret, err2 := p.handler.MZRem(ctx, args.Appid, args.Key, args.Members); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorZRemRangeByRank struct {
processorBase
handler RedisProxy
}
func (p *processorZRemRangeByRank) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ZRemRangeByRankArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ZRemRangeByRankResult{}
if ret, err2 := p.handler.ZRemRangeByRank(ctx, args.Appid, args.Key, args.Start, args.Stop); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorZRemRangeByScore struct {
processorBase
handler RedisProxy
}
func (p *processorZRemRangeByScore) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ZRemRangeByScoreArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ZRemRangeByScoreResult{}
if ret, err2 := p.handler.ZRemRangeByScore(ctx, args.Appid, args.Key, args.Min, args.Max); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorZIncrBy struct {
processorBase
handler RedisProxy
}
func (p *processorZIncrBy) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ZIncrByArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ZIncrByResult{}
if ret, err2 := p.handler.ZIncrBy(ctx, args.Appid, args.Key, args.Increment, args.Member); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorZScore struct {
processorBase
handler RedisProxy
}
func (p *processorZScore) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ZScoreArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ZScoreResult{}
if ret, err2 := p.handler.ZScore(ctx, args.Appid, args.Key, args.Member); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorSAdd struct {
processorBase
handler RedisProxy
}
func (p *processorSAdd) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := SAddArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := SAddResult{}
if ret, err2 := p.handler.SAdd(ctx, args.Appid, args.Key, args.Member); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMSAdd struct {
processorBase
handler RedisProxy
}
func (p *processorMSAdd) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MsAddArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MsAddResult{}
if ret, err2 := p.handler.MSAdd(ctx, args.Appid, args.Key, args.Members); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorSCard struct {
processorBase
handler RedisProxy
}
func (p *processorSCard) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := SCardArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := SCardResult{}
if ret, err2 := p.handler.SCard(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorSIsMember struct {
processorBase
handler RedisProxy
}
func (p *processorSIsMember) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := SIsMemberArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := SIsMemberResult{}
if ret, err2 := p.handler.SIsMember(ctx, args.Appid, args.Key, args.Member); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorSMembers struct {
processorBase
handler RedisProxy
}
func (p *processorSMembers) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := SMembersArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := SMembersResult{}
if ret, err2 := p.handler.SMembers(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorSRandMember struct {
processorBase
handler RedisProxy
}
func (p *processorSRandMember) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := SRandMemberArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := SRandMemberResult{}
if ret, err2 := p.handler.SRandMember(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorSRandMemberN struct {
processorBase
handler RedisProxy
}
func (p *processorSRandMemberN) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := SRandMemberNArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := SRandMemberNResult{}
if ret, err2 := p.handler.SRandMemberN(ctx, args.Appid, args.Key, args.N); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorSRem struct {
processorBase
handler RedisProxy
}
func (p *processorSRem) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := SRemArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := SRemResult{}
if ret, err2 := p.handler.SRem(ctx, args.Appid, args.Key, args.Member); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMSRem struct {
processorBase
handler RedisProxy
}
func (p *processorMSRem) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MsRemArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MsRemResult{}
if ret, err2 := p.handler.MSRem(ctx, args.Appid, args.Key, args.Member); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorLPush struct {
processorBase
handler RedisProxy
}
func (p *processorLPush) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := LPushArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := LPushResult{}
if ret, err2 := p.handler.LPush(ctx, args.Appid, args.Key, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorLPushByte struct {
processorBase
handler RedisProxy
}
func (p *processorLPushByte) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := LPushByteArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := LPushByteResult{}
if ret, err2 := p.handler.LPushByte(ctx, args.Appid, args.Key, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorRPush struct {
processorBase
handler RedisProxy
}
func (p *processorRPush) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := RPushArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := RPushResult{}
if ret, err2 := p.handler.RPush(ctx, args.Appid, args.Key, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorRPushByte struct {
processorBase
handler RedisProxy
}
func (p *processorRPushByte) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := RPushByteArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := RPushByteResult{}
if ret, err2 := p.handler.RPushByte(ctx, args.Appid, args.Key, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMLPush struct {
processorBase
handler RedisProxy
}
func (p *processorMLPush) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MlPushArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MlPushResult{}
if ret, err2 := p.handler.MLPush(ctx, args.Appid, args.Key, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMLPushWithTTL struct {
processorBase
handler RedisProxy
}
func (p *processorMLPushWithTTL) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MlPushWithTTLArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MlPushWithTTLResult{}
if ret, err2 := p.handler.MLPushWithTTL(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMLPushByteWithTTL struct {
processorBase
handler RedisProxy
}
func (p *processorMLPushByteWithTTL) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MlPushByteWithTTLArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MlPushByteWithTTLResult{}
if ret, err2 := p.handler.MLPushByteWithTTL(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMRPushWithTTL struct {
processorBase
handler RedisProxy
}
func (p *processorMRPushWithTTL) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MrPushWithTTLArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MrPushWithTTLResult{}
if ret, err2 := p.handler.MRPushWithTTL(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMRPushByteWithTTL struct {
processorBase
handler RedisProxy
}
func (p *processorMRPushByteWithTTL) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MrPushByteWithTTLArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MrPushByteWithTTLResult{}
if ret, err2 := p.handler.MRPushByteWithTTL(ctx, args.Appid, args.Key, args.Value, args.TTL); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorLPop struct {
processorBase
handler RedisProxy
}
func (p *processorLPop) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ProxyLPopArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := LPopResult{}
if ret, err2 := p.handler.LPop(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorLPopByte struct {
processorBase
handler RedisProxy
}
func (p *processorLPopByte) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := LPopByteArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := LPopByteResult{}
if ret, err2 := p.handler.LPopByte(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorRPop struct {
processorBase
handler RedisProxy
}
func (p *processorRPop) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := RPopArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := RPopResult{}
if ret, err2 := p.handler.RPop(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorRPopByte struct {
processorBase
handler RedisProxy
}
func (p *processorRPopByte) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := RPopByteArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := RPopByteResult{}
if ret, err2 := p.handler.RPopByte(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorLInsertBefore struct {
processorBase
handler RedisProxy
}
func (p *processorLInsertBefore) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := LInsertBeforeArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := LInsertBeforeResult{}
if ret, err2 := p.handler.LInsertBefore(ctx, args.Appid, args.Key, args.Pivot, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorLInsertAfter struct {
processorBase
handler RedisProxy
}
func (p *processorLInsertAfter) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := LInsertAfterArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := LInsertAfterResult{}
if ret, err2 := p.handler.LInsertAfter(ctx, args.Appid, args.Key, args.Pivot, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorLLen struct {
processorBase
handler RedisProxy
}
func (p *processorLLen) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := LLenArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := LLenResult{}
if ret, err2 := p.handler.LLen(ctx, args.Appid, args.Key); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorMLLen struct {
processorBase
handler RedisProxy
}
func (p *processorMLLen) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := MlLenArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := MlLenResult{}
if ret, err2 := p.handler.MLLen(ctx, args.Appid, args.Keys); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorLSet struct {
processorBase
handler RedisProxy
}
func (p *processorLSet) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := LSetArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := LSetResult{}
if ret, err2 := p.handler.LSet(ctx, args.Appid, args.Key, args.Index, args.Value); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorLIndex struct {
processorBase
handler RedisProxy
}
func (p *processorLIndex) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := LIndexArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := LIndexResult{}
if ret, err2 := p.handler.LIndex(ctx, args.Appid, args.Key, args.Index); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorLRange struct {
processorBase
handler RedisProxy
}
func (p *processorLRange) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := LRangeArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := LRangeResult{}
if ret, err2 := p.handler.LRange(ctx, args.Appid, args.Key, args.Start, args.Stop); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorLTrim struct {
processorBase
handler RedisProxy
}
func (p *processorLTrim) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := LTrimArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := LTrimResult{}
if ret, err2 := p.handler.LTrim(ctx, args.Appid, args.Key, args.Start, args.Stop); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorClusterNodes struct {
processorBase
handler RedisProxy
}
func (p *processorClusterNodes) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ClusterNodesArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ClusterNodesResult{}
if ret, err2 := p.handler.ClusterNodes(ctx, args.Appid); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorClusterInfo struct {
processorBase
handler RedisProxy
}
func (p *processorClusterInfo) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := ClusterInfoArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := ClusterInfoResult{}
if ret, err2 := p.handler.ClusterInfo(ctx, args.Appid); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorInfo struct {
processorBase
handler RedisProxy
}
func (p *processorInfo) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := InfoArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := InfoResult{}
if ret, err2 := p.handler.Info(ctx, args.Appid, args.Sections); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
type processorNodeInfo struct {
processorBase
handler RedisProxy
}
func (p *processorNodeInfo) Process(ctx context.Context, seqId int32, in, out thrift.TProtocol) (success bool, err thrift.TException) {
args := NodeInfoArgs{}
if _, err := p.Read(ctx, in, out, &args, seqId); err != nil {
return false, err
}
result := NodeInfoResult{}
if ret, err2 := p.handler.NodeInfo(ctx, args.Appid, args.Addr, args.Sections); err2 != nil {
return p.CmdException(ctx, in, out, seqId, err2)
} else {
result.Success = ret
}
return p.Cmd(ctx, in, out, &result, seqId)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/h79/goutils.git
git@gitee.com:h79/goutils.git
h79
goutils
goutils
v1.4.22

搜索帮助