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

Method Sync

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

GetMethod · 0.45
ResetMethod · 0.45
PutMethod · 0.45
LastMethod · 0.45

Tested by

no test coverage detected