Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for MarshalIndent (0.34 sec)

  1. istioctl/pkg/writer/ztunnel/configdump/services.go

    		if r := cmp.Compare(a.Namespace, b.Namespace); r != 0 {
    			return r
    		}
    		if r := cmp.Compare(a.Name, b.Name); r != 0 {
    			return r
    		}
    		return cmp.Compare(a.Hostname, b.Hostname)
    	})
    	out, err := json.MarshalIndent(svcs, "", "    ")
    	if err != nil {
    		return fmt.Errorf("failed to marshal workloads: %v", err)
    	}
    	if outputFormat == "yaml" {
    		if out, err = yaml.JSONToYAML(out); err != nil {
    			return err
    		}
    	}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Apr 23 21:30:30 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  2. cni/pkg/util/pluginutil.go

    		return
    	}
    	return
    }
    
    // Marshal the CNI config map and append a new line
    func MarshalCNIConfig(cniConfigMap map[string]any) ([]byte, error) {
    	cniConfig, err := json.MarshalIndent(cniConfigMap, "", "  ")
    	if err != nil {
    		return nil, err
    	}
    	cniConfig = append(cniConfig, "\n"...)
    	return cniConfig, nil
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  3. istioctl/pkg/writer/ztunnel/configdump/policies.go

    	slices.SortFunc(policies, func(a, b *ZtunnelPolicy) int {
    		if r := cmp.Compare(a.Namespace, b.Namespace); r != 0 {
    			return r
    		}
    		return cmp.Compare(a.Name, b.Name)
    	})
    	out, err := json.MarshalIndent(policies, "", "    ")
    	if err != nil {
    		return fmt.Errorf("failed to marshal policies: %v", err)
    	}
    	if outputFormat == "yaml" {
    		if out, err = yaml.JSONToYAML(out); err != nil {
    			return err
    		}
    	}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Apr 23 21:30:30 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  4. istioctl/pkg/writer/ztunnel/configdump/connections.go

    	})
    	workloads = slices.FilterInPlace(workloads, func(state WorkloadState) bool {
    		if filter.Namespace != "" && filter.Namespace != state.Info.Namespace {
    			return false
    		}
    		return true
    	})
    	out, err := json.MarshalIndent(workloads, "", "    ")
    	if err != nil {
    		return fmt.Errorf("failed to marshal workloads: %v", err)
    	}
    	if outputFormat == "yaml" {
    		if out, err = yaml.JSONToYAML(out); err != nil {
    			return err
    		}
    	}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Mon Apr 22 15:39:28 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  5. istioctl/pkg/writer/pilot/status.go

    			}
    
    			sort.Slice(fullStatus, func(i, j int) bool {
    				return fullStatus[i].proxyID < fullStatus[j].proxyID
    			})
    		}
    	}
    	if len(mappedResp) > 0 {
    		mresp, err := json.MarshalIndent(mappedResp, "", "  ")
    		if err != nil {
    			return nil, nil, err
    		}
    		_, _ = s.Writer.Write(mresp)
    		_, _ = s.Writer.Write([]byte("\n"))
    	}
    
    	return w, fullStatus, nil
    }
    
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Mar 15 04:16:55 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  6. istioctl/pkg/util/formatting/formatter.go

    	for _, m := range ms {
    		logOutput = append(logOutput, render(m, colorize))
    	}
    	return strings.Join(logOutput, "\n")
    }
    
    func printJSON(ms diag.Messages) (string, error) {
    	jsonOutput, err := json.MarshalIndent(ms, "", "\t")
    	return string(jsonOutput), err
    }
    
    func printYAML(ms diag.Messages) (string, error) {
    	yamlOutput, err := yaml.Marshal(ms)
    	return string(yamlOutput), err
    }
    
    // Formatting options for Message
    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)
  7. istioctl/pkg/writer/envoy/configdump/cluster.go

    	filteredClusters := make(proto.MessageSlice, 0, len(clusters))
    	for _, cluster := range clusters {
    		if filter.Verify(cluster) {
    			filteredClusters = append(filteredClusters, cluster)
    		}
    	}
    	out, err := json.MarshalIndent(filteredClusters, "", "    ")
    	if err != nil {
    		return err
    	}
    	if outputFormat == "yaml" {
    		if out, err = yaml.JSONToYAML(out); err != nil {
    			return err
    		}
    	}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Thu May 11 05:38:17 GMT 2023
    - 5.9K bytes
    - Viewed (0)
  8. istioctl/pkg/writer/ztunnel/configdump/certificates.go

    func (c *ConfigWriter) PrintSecretDump(outputFormat string) error {
    	if c.ztunnelDump == nil {
    		return fmt.Errorf("config writer has not been primed")
    	}
    	secretDump := c.ztunnelDump.Certificates
    	out, err := json.MarshalIndent(secretDump, "", "    ")
    	if err != nil {
    		return fmt.Errorf("failed to marshal secrets dump: %v", err)
    	}
    	if outputFormat == "yaml" {
    		if out, err = yaml.JSONToYAML(out); err != nil {
    			return err
    		}
    	}
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Thu Apr 25 16:38:16 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  9. istioctl/pkg/writer/ztunnel/configdump/workload.go

    	filteredWorkloads := []*ZtunnelWorkload{}
    	for _, workload := range zDump.Workloads {
    		if filter.Verify(workload) {
    			filteredWorkloads = append(filteredWorkloads, workload)
    		}
    	}
    	out, err := json.MarshalIndent(filteredWorkloads, "", "    ")
    	if err != nil {
    		return fmt.Errorf("failed to marshal workloads: %v", err)
    	}
    	if outputFormat == "yaml" {
    		if out, err = yaml.JSONToYAML(out); err != nil {
    			return err
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Tue Apr 23 21:30:30 GMT 2024
    - 4K bytes
    - Viewed (0)
  10. docs/sts/web-identity.go

    			bucketNames = append(bucketNames, bucket.Name)
    		}
    		response := make(map[string]interface{})
    		response["credentials"] = creds
    		response["buckets"] = bucketNames
    		c, err := json.MarshalIndent(response, "", "\t")
    		if err != nil {
    			http.Error(w, err.Error(), http.StatusInternalServerError)
    			return
    		}
    		w.Write(c)
    	})
    
    	address := fmt.Sprintf(":%v", port)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri May 19 09:13:33 GMT 2023
    - 7.8K bytes
    - Viewed (3)
Back to top