Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for NewCell (0.2 sec)

  1. istioctl/pkg/writer/table/writer_test.go

    	w := NewStyleWriter(got)
    	w.AddHeader("NAME", "NAMESPACE", "VERSION")
    	w.SetAddRowFunc(func(obj interface{}) Row {
    		o := obj.(testObject)
    		return Row{
    			Cells: []Cell{
    				NewCell(o.name),
    				NewCell(o.namespace, color.FgGreen),
    				NewCell(o.version),
    			},
    		}
    	})
    	w.AddRow(newTestObject("foo", "bar", "1.0"))
    	w.AddRow(newTestObject("baz", "qux", "2.0"))
    	w.AddRow(newTestObject("qux", "quux", "3"))
    	w.Flush()
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Oct 08 04:41:42 GMT 2022
    - 1.6K bytes
    - Viewed (0)
  2. istioctl/pkg/checkinject/checkinject.go

    			Cells: make([]table.Cell, 0),
    		}
    		row.Cells = append(row.Cells, table.NewCell(wa.Name), table.NewCell(wa.Revision))
    		if wa.Injected {
    			row.Cells = append(row.Cells, table.NewCell("✔", color.FgGreen))
    		} else {
    			row.Cells = append(row.Cells, table.NewCell("✘", color.FgRed))
    		}
    		row.Cells = append(row.Cells, table.NewCell(wa.Reason))
    		return row
    	})
    	w.AddHeader("WEBHOOK", "REVISION", "INJECTED", "REASON")
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Apr 13 05:23:38 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  3. istioctl/pkg/writer/table/writer.go

    		header: Row{},
    	}
    }
    
    type BuildRowFunc func(obj interface{}) Row
    
    type Cell struct {
    	Value      string
    	Attributes []color.Attribute
    }
    
    type Row struct {
    	Cells []Cell
    }
    
    func NewCell(value string, attributes ...color.Attribute) Cell {
    	attrs := append([]color.Attribute{}, attributes...)
    	return Cell{value, attrs}
    }
    
    func (cell Cell) String() string {
    	if len(cell.Attributes) == 0 {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Oct 08 04:41:42 GMT 2022
    - 2.8K bytes
    - Viewed (0)
Back to top