Add more func comments

This commit is contained in:
Joel Watson 2020-11-10 16:40:12 -06:00
parent 8bb2a274ce
commit 5f2896d4a7
1 changed files with 6 additions and 0 deletions

View File

@ -172,6 +172,8 @@ type typeStats struct {
Count int Count int
} }
// Generate the stats for the output struct that's
// used to produce the printed output the user sees.
func generateStats(info SnapshotInfo) []typeStats { func generateStats(info SnapshotInfo) []typeStats {
ss := make([]typeStats, 0, len(info.Stats)) ss := make([]typeStats, 0, len(info.Stats))
@ -184,6 +186,8 @@ func generateStats(info SnapshotInfo) []typeStats {
return ss return ss
} }
// Generate the KV stats for the output struct that's
// used to produce the printed output the user sees.
func generateKVStats(info SnapshotInfo) []typeStats { func generateKVStats(info SnapshotInfo) []typeStats {
if info.StatsKV != nil { if info.StatsKV != nil {
ks := make([]typeStats, 0, len(info.StatsKV)) ks := make([]typeStats, 0, len(info.StatsKV))
@ -269,6 +273,8 @@ func (c *cmd) enhance(file io.Reader) (SnapshotInfo, error) {
} }
// kvEnhance populates the struct with all of the snapshot's
// size information for KV data stored in it
func (c *cmd) kvEnhance(keyType string, val interface{}, size int, info *SnapshotInfo) { func (c *cmd) kvEnhance(keyType string, val interface{}, size int, info *SnapshotInfo) {
// automatically set kvDetails to true if a depth or filter // automatically set kvDetails to true if a depth or filter
// is provided. this allows the user to omit the -kvdetails // is provided. this allows the user to omit the -kvdetails