MCPcopy
hub / github.com/etcd-io/etcd / iterateBucketCommandFunc

Function iterateBucketCommandFunc

tools/etcd-dump-db/main.go:101–117  ·  view source on GitHub ↗
(_ *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

99}
100
101func iterateBucketCommandFunc(_ *cobra.Command, args []string) {
102 if len(args) != 2 {
103 log.Fatalf("Must provide 2 arguments (got %v)", args)
104 }
105 dp := args[0]
106 if !strings.HasSuffix(dp, "db") {
107 dp = filepath.Join(snapDir(dp), "db")
108 }
109 if !existFileOrDir(dp) {
110 log.Fatalf("%q does not exist", dp)
111 }
112 bucket := args[1]
113 err := iterateBucket(dp, bucket, iterateBucketLimit, iterateBucketDecode)
114 if err != nil {
115 log.Fatal(err)
116 }
117}
118
119func scanKeysCommandFunc(_ *cobra.Command, args []string) {
120 if len(args) != 2 {

Callers

nothing calls this directly

Calls 5

existFileOrDirFunction · 0.85
iterateBucketFunction · 0.85
snapDirFunction · 0.70
FatalfMethod · 0.65
FatalMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…