func (s Server) PP(printer util.Printer) { if s.Vendor.Name == "" { printer.Print("v%s\n%s", s.Version, s.Couchdb) } else { printer.Print("v%s - %s\n%s", s.Version, s.Vendor.Name, s.Couchdb) } }
func (s Stat) PP(printer util.Printer) { var header string if s.Description == "" { header = fmt.Sprintf("[%s:%s]", s.Section, s.SubSection) } else { header = fmt.Sprintf(`[%s:%s "%s"]`, s.Section, s.SubSection, s.TrimmedDescription()) } printer.Print(header) printer.Print(" Current %v", s.Current) printer.Print(" Sum %v", s.Sum) printer.Print(" Min/Max %v/%v", s.Min, s.Max) printer.Print(" Mean %v", s.Mean) }
func (a ActiveTask) PP(printer util.Printer) { progress := fmt.Sprintf("%02d%%", a.Progress) var addInfo string switch a.Type { case "replication": addInfo = fmt.Sprintf("%s → %s", a.Source, a.Target) if a.Continuous { addInfo += " (continuous)" } case "indexer": addInfo = fmt.Sprintf("%s/%s", a.Database.String(), a.DesignDocument.String()) default: addInfo = a.Database.String() } printer.Print("[%s %s]\n %s", progress, a.Type, addInfo) }
func (s Session) PP(printer util.Printer) { printer.Print("Name: %s\nRoles: %s", s.UserCtx.Name, strings.Join(s.UserCtx.Roles, ", ")) }
func (d Database) PP(printer util.Printer) { printer.Print(d.String()) }
func (c couchdbutils) PP(printer util.Printer) { printer.Print("%s v%s\n%s", c.Name, c.Version, c.Description) }
func (r Result) PP(printer util.Printer) { printer.Print("# %s %s %d", r.Method, r.Path, r.StatusCode) }