Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 554 for readFile (0.23 sec)

  1. cmd/naughty-disk_test.go

    	}
    	return d.disk.ListDir(ctx, origvolume, volume, dirPath, count)
    }
    
    func (d *naughtyDisk) ReadFile(ctx context.Context, volume string, path string, offset int64, buf []byte, verifier *BitrotVerifier) (n int64, err error) {
    	if err := d.calcError(); err != nil {
    		return 0, err
    	}
    	return d.disk.ReadFile(ctx, volume, path, offset, buf, verifier)
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Apr 23 17:15:52 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  2. cni/pkg/install/cniconfig.go

    	return writeCNIConfig(ctx, cniConfig, getPluginConfig(cfg))
    }
    
    func readCNIConfigTemplate(template cniConfigTemplate) ([]byte, error) {
    	if file.Exists(template.cniNetworkConfigFile) {
    		cniConfig, err := os.ReadFile(template.cniNetworkConfigFile)
    		if err != nil {
    			return nil, err
    		}
    		installLog.Infof("Using CNI config template from %s", template.cniNetworkConfigFile)
    		return cniConfig, nil
    	}
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 10.4K bytes
    - Viewed (0)
  3. internal/s3select/json/reader_test.go

    	}
    }
    
    func BenchmarkReader(b *testing.B) {
    	files, err := os.ReadDir("testdata")
    	if err != nil {
    		b.Fatal(err)
    	}
    	for _, file := range files {
    		b.Run(file.Name(), func(b *testing.B) {
    			f, err := os.ReadFile(filepath.Join("testdata", file.Name()))
    			if err != nil {
    				b.Fatal(err)
    			}
    			b.SetBytes(int64(len(f)))
    			b.ReportAllocs()
    			b.ResetTimer()
    			var record sql.Record
    			for i := 0; i < b.N; i++ {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  4. istioctl/pkg/proxyconfig/proxyconfig_test.go

    	expectedString string // String output is expected to contain
    
    	wantException bool
    }
    
    func TestProxyConfig(t *testing.T) {
    	loggingConfig := map[string][]byte{
    		"details-v1-5b7f94f9bc-wp5tb": util.ReadFile(t, "../writer/envoy/logging/testdata/logging.txt"),
    		"httpbin-794b576b6c-qx6pf":    []byte("{}"),
    	}
    	cases := []execTestCase{
    		{
    			args:           []string{},
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Wed Apr 10 21:51:29 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  5. cmd/handler-api.go

    	cgroupV2MemLimitFile = "/sys/fs/cgroup/memory.max"
    	cgroupMemNoLimit     = 9223372036854771712
    )
    
    func cgroupMemLimit() (limit uint64) {
    	buf, err := os.ReadFile(cgroupV2MemLimitFile)
    	if err != nil {
    		buf, err = os.ReadFile(cgroupV1MemLimitFile)
    	}
    	if err != nil {
    		return 0
    	}
    	limit, err = strconv.ParseUint(strings.TrimSpace(string(buf)), 10, 64)
    	if err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 08 09:22:27 GMT 2024
    - 10K bytes
    - Viewed (0)
  6. internal/s3select/simdj/reader_amd64_test.go

    	Fatal(args ...interface{})
    }
    
    func loadCompressed(t tester, file string) (js []byte) {
    	dec, err := zstd.NewReader(nil)
    	if err != nil {
    		t.Fatal(err)
    	}
    	defer dec.Close()
    	js, err = os.ReadFile(filepath.Join("testdata", file+".json.zst"))
    	if err != nil {
    		t.Fatal(err)
    	}
    	js, err = dec.DecodeAll(js, nil)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	return js
    }
    
    var testCases = []struct {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.9K bytes
    - Viewed (0)
  7. cmd/storage-interface.go

    	// File operations.
    	ListDir(ctx context.Context, origvolume, volume, dirPath string, count int) ([]string, error)
    	ReadFile(ctx context.Context, volume string, path string, offset int64, buf []byte, verifier *BitrotVerifier) (n int64, err error)
    	AppendFile(ctx context.Context, volume string, path string, buf []byte) (err error)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Apr 23 17:15:52 GMT 2024
    - 4.9K bytes
    - Viewed (0)
  8. docs/debugging/healing-bin/main.go

    					}
    					ht[file.Name] = htr
    				}
    			}
    			b, err := json.MarshalIndent(ht, "", "  ")
    			if err != nil {
    				return err
    			}
    			fmt.Println(string(b))
    			return nil
    		}
    		b, err := os.ReadFile(file)
    		if err != nil {
    			return err
    		}
    		buf := bytes.NewBuffer(nil)
    		if _, err = msgp.CopyToJSON(buf, bytes.NewReader(b)); err != nil {
    			return err
    		}
    		var htr map[string]interface{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.2K bytes
    - Viewed (0)
  9. istioctl/pkg/workload/workload_test.go

    					ObjectMeta: metav1.ObjectMeta{Namespace: "istio-system", Name: "istio-rev-1"},
    					Data: map[string]string{
    						"mesh": string(util.ReadFile(t, path.Join(testdir, "meshconfig.yaml"))),
    					},
    				}, metav1.CreateOptions{})
    				client.Kube().CoreV1().Secrets("bar").Create(context.Background(), &v1.Secret{
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Wed Mar 27 16:59:05 GMT 2024
    - 14.6K bytes
    - Viewed (0)
  10. cni/pkg/util/pluginutil.go

    				return
    			}
    			errChan <- err
    		}
    	}
    }
    
    // Read CNI config from file and return the unmarshalled JSON as a map
    func ReadCNIConfigMap(path string) (map[string]any, error) {
    	cniConfig, err := os.ReadFile(path)
    	if err != nil {
    		return nil, err
    	}
    
    	var cniConfigMap map[string]any
    	if err = json.Unmarshal(cniConfig, &cniConfigMap); err != nil {
    		return nil, fmt.Errorf("%s: %w", path, err)
    	}
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 3.6K bytes
    - Viewed (0)
Back to top