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

Function IgnoreCMDMiddleware

IceFireDB-PubSub/pkg/router/ignorecmd.go:29–39  ·  view source on GitHub ↗

Start the middleware according to the configuration

(enable bool, cmdList []string)

Source from the content-addressed store, hash-verified

27
28// Start the middleware according to the configuration
29func IgnoreCMDMiddleware(enable bool, cmdList []string) HandlerFunc {
30 return func(context *Context) error {
31 // Ignore custom commands
32 if enable && len(cmdList) > 0 {
33 if utils.InArray(context.Cmd, cmdList) {
34 return fmt.Errorf(ErrUnknownCommand, context.Cmd)
35 }
36 }
37 return context.Next()
38 }
39}

Callers 1

NewFunction · 0.92

Calls 2

InArrayFunction · 0.92
NextMethod · 0.45

Tested by

no test coverage detected