Search Options

Results per page
Sort
Preferred Languages
Advance

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

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

    		name:      name,
    		namespace: namespace,
    		version:   version,
    	}
    }
    
    func TestWriter(t *testing.T) {
    	got := &bytes.Buffer{}
    	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),
    			},
    		}
    	})
    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/writer/table/writer.go

    	if len(c.header.Cells) != 0 {
    		output = append(output, c.header.Cells)
    	}
    	for _, row := range allRows {
    		output = append(output, row.Cells)
    	}
    	return output
    }
    
    func (c *ColoredTableWriter) SetAddRowFunc(f func(obj interface{}) Row) {
    	c.addRowFunc = f
    }
    
    func (c *ColoredTableWriter) AddHeader(names ...string) {
    	cells := make([]Cell, 0)
    	for _, name := range names {
    		cells = append(cells, NewCell(name))
    	}
    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)
  3. istioctl/pkg/checkinject/checkinject.go

    	if len(was) == 0 {
    		fmt.Fprintf(writer, "ERROR: no Istio injection hooks present.\n")
    		return nil
    	}
    	w := table.NewStyleWriter(writer)
    	w.SetAddRowFunc(func(obj interface{}) table.Row {
    		wa := obj.(webhookAnalysis)
    		row := table.Row{
    			Cells: make([]table.Cell, 0),
    		}
    		row.Cells = append(row.Cells, table.NewCell(wa.Name), table.NewCell(wa.Revision))
    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)
Back to top