Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for printJSON (0.21 sec)

  1. istioctl/pkg/util/formatting/formatter.go

    func Print(ms diag.Messages, format string, colorize bool) (string, error) {
    	switch format {
    	case LogFormat:
    		return printLog(ms, colorize), nil
    	case JSONFormat:
    		return printJSON(ms)
    	case YAMLFormat:
    		return printYAML(ms)
    	default:
    		return "", fmt.Errorf("invalid format, expected one of %v but got %q", MsgOutputFormatKeys, format)
    	}
    }
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Jul 11 02:41:45 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  2. istioctl/pkg/util/formatting/formatter_test.go

    		"\033[1;31mError\033[0m [B1] (SoapBubble) Explosion accident: the bubble is too big\n" +
    			"\033[33mWarning\033[0m [C1] (GrandCastle) Collapse danger: the castle is too old",
    	))
    }
    
    func TestFormatter_PrintJSON(t *testing.T) {
    	g := NewWithT(t)
    
    	firstMsg := diag.NewMessage(
    		diag.NewMessageType(diag.Error, "B1", "Explosion accident: %v"),
    		diag.MockResource("SoapBubble"),
    		"the bubble is too big",
    	)
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Oct 31 14:48:28 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  3. istioctl/pkg/tag/tag.go

    		if r := cmp.Compare(a.Revision, b.Revision); r != 0 {
    			return r
    		}
    		return cmp.Compare(a.Tag, b.Tag)
    	})
    
    	switch outputFormat {
    	case util.JSONFormat:
    		return PrintJSON(writer, tags)
    	case util.TableFormat:
    	default:
    		return fmt.Errorf("unknown format: %s", outputFormat)
    	}
    	w := new(tabwriter.Writer).Init(writer, 0, 8, 1, ' ', 0)
    	fmt.Fprintln(w, "TAG\tREVISION\tNAMESPACES")
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Apr 02 08:32:06 GMT 2024
    - 16.3K bytes
    - Viewed (0)
Back to top