Пример #1
0
func (t Task) ToColumns(output io.Writer) error {
	w := cli.NewTabWriter(output)

	fmt.Fprintf(w, OBJ_FMT, "ID", t.ID)
	fmt.Fprintf(w, OBJ_FMT, "AppID", t.AppID)
	fmt.Fprintf(w, OBJ_FMT, "Version", t.Version)
	fmt.Fprintf(w, OBJ_FMT, "Staged", cli.FormatDate(t.StagedAt))
	fmt.Fprintf(w, OBJ_FMT, "Started", cli.FormatDate(t.StartedAt))
	fmt.Fprintf(w, OBJ_FMT, "Host", t.Host)
	fmt.Fprintf(w, OBJ_FMT, "Ports", utils.ConcatInts(t.Ports))

	cli.FlushWriter(w)
	return nil
}
Пример #2
0
func (t Tasks) ToColumns(output io.Writer) error {
	w := cli.NewTabWriter(output)
	fmt.Fprintln(w, "\nAPP_ID\tHOST\tVERSION\tSTARTED_AT\tTASK_ID")
	for _, e := range t.Tasks {
		fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", e.AppID, e.Host, e.Version, cli.FormatDate(e.StartedAt), e.ID)
	}
	cli.FlushWriter(w)
	return nil
}