MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / RequiredRaftEngine

Function RequiredRaftEngine

server/middleware/middleware.go:140–150  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

138}
139
140func RequiredRaftEngine(c *gin.Context) {
141 storage, _ := c.MustGet(consts.ContextKeyStore).(*store.ClusterStore)
142 raftNode, ok := storage.GetEngine().(*raft.Node)
143 if !ok {
144 helper.ResponseBadRequest(c, errors.New("raft engine is not enabled"))
145 c.Abort()
146 return
147 }
148 c.Set(consts.ContextKeyRaftNode, raftNode)
149 c.Next()
150}

Callers

nothing calls this directly

Calls 3

ResponseBadRequestFunction · 0.92
GetEngineMethod · 0.80
SetMethod · 0.65

Tested by

no test coverage detected