Exemplo n.º 1
0
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)
	}
}
Exemplo n.º 2
0
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)
}
Exemplo n.º 3
0
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)
}
Exemplo n.º 4
0
func (s Session) PP(printer util.Printer) {
	printer.Print("Name: %s\nRoles: %s", s.UserCtx.Name, strings.Join(s.UserCtx.Roles, ", "))
}
Exemplo n.º 5
0
func (d Database) PP(printer util.Printer) {
	printer.Print(d.String())
}
Exemplo n.º 6
0
func (c couchdbutils) PP(printer util.Printer) {
	printer.Print("%s v%s\n%s", c.Name, c.Version, c.Description)
}
Exemplo n.º 7
0
func (r Result) PP(printer util.Printer) {
	printer.Print("# %s %s %d", r.Method, r.Path, r.StatusCode)
}