diff options
Diffstat (limited to 'pkg/commands/flushall.go')
| -rw-r--r-- | pkg/commands/flushall.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/commands/flushall.go b/pkg/commands/flushall.go new file mode 100644 index 0000000..9f1316a --- /dev/null +++ b/pkg/commands/flushall.go @@ -0,0 +1,14 @@ +package commands + +import ( + "redisClone/pkg/core" +) + +func Flushall(args []string, getShard func(k string) *core.Shard) interface{} { + return dbInstance.ExecuteAll(func(shards []*core.Shard) interface{} { + for _, shard := range shards { + shard.Data = make(map[string]core.Item) + } + return core.SimpleString("OK") + }) +} |
