MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Sync

Method Sync

IceFireDB-Redis-Proxy/pkg/router/redisCluster/router.go:97–118  ·  view source on GitHub ↗
(args []interface{})

Source from the content-addressed store, hash-verified

95}
96
97func (r *Router) Sync(args []interface{}) error {
98 cmdType := strings.ToUpper(args[0].(string))
99 op, ok := router.OpTable[cmdType]
100 handlers, ok := r.cmd[cmdType]
101 if !ok {
102 handlers = r.cmd[CMDEXEC]
103 }
104 c := r.pool.Get().(*router.Context)
105 defer func() {
106 c.Reset()
107 r.pool.Put(c)
108 }()
109
110 c.Index = int8(len(handlers) - 1)
111 c.Writer = RESPHandle.NewWriterHandle(io.Discard)
112 c.Args = args
113 c.Handlers = handlers
114 c.Cmd = cmdType
115 c.Op = op.Flag
116 c.Reply = nil
117 return c.Next()
118}
119
120var _ router.IRoutes = (*Router)(nil)
121

Callers

nothing calls this directly

Calls 4

GetMethod · 0.45
ResetMethod · 0.45
PutMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected