MCPcopy
hub / github.com/etcd-io/bbolt / printAllPages

Function printAllPages

cmd/bbolt/command/command_page.go:117–137  ·  view source on GitHub ↗
(cmd *cobra.Command, path string, formatValue string)

Source from the content-addressed store, hash-verified

115}
116
117func printAllPages(cmd *cobra.Command, path string, formatValue string) {
118 _, hwm, err := guts_cli.ReadPageAndHWMSize(path)
119 if err != nil {
120 fmt.Fprintf(cmd.OutOrStdout(), "cannot read number of pages: %v", err)
121 }
122
123 // print each page listed.
124 for pageID := uint64(0); pageID < uint64(hwm); {
125 // print a separator.
126 if pageID > 0 {
127 fmt.Fprintln(cmd.OutOrStdout(), "===============================================")
128 }
129 overflow, pErr := printPage(cmd, path, pageID, formatValue)
130 if pErr != nil {
131 fmt.Fprintf(cmd.OutOrStdout(), "Prining page %d failed: %s. Continuing...\n", pageID, pErr)
132 pageID++
133 } else {
134 pageID += uint64(overflow) + 1
135 }
136 }
137}
138
139// pagePrintMeta prints the data from the meta page.
140func pagePrintMeta(w io.Writer, buf []byte) error {

Callers 1

pageFuncFunction · 0.85

Calls 2

ReadPageAndHWMSizeFunction · 0.92
printPageFunction · 0.85

Tested by

no test coverage detected