Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 185 for readFile (0.18 sec)

  1. istioctl/pkg/writer/compare/comparator_test.go

    func TestComparatorMismatchedConfigs(t *testing.T) {
    	cfg, err := os.ReadFile("testdata/configdump.json")
    	if err != nil {
    		t.Fatalf("Failed to read test data: %v", err)
    	}
    	diffCfg, err := os.ReadFile("testdata/configdump_diff.json")
    	if err != nil {
    		t.Fatalf("Failed to read test data: %v", err)
    	}
    
    	var outputBuffer bytes.Buffer
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Mar 12 10:02:09 GMT 2024
    - 2.3K bytes
    - Viewed (0)
  2. istioctl/pkg/writer/ztunnel/configdump/configdump_test.go

    			inputFile:   "testdata/dump.json",
    			wantConfigs: 27,
    			wantErr:     false,
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			cw := &ConfigWriter{}
    			cd, _ := os.ReadFile(tt.inputFile)
    			err := cw.Prime(cd)
    			if cw.ztunnelDump == nil {
    				if tt.wantConfigs != 0 {
    					t.Errorf("wanted some configs loaded but config dump was nil")
    				}
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Feb 02 18:21:48 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  3. operator/cmd/mesh/manifest_shared_test.go

    		for _, o := range objects.Items {
    			no := o.DeepCopy()
    			out = append(out, object.NewK8sObject(no, nil, nil))
    		}
    	}
    	return out
    }
    
    // readFile reads a file and returns the contents.
    func readFile(path string) (string, error) {
    	b, err := os.ReadFile(path)
    	return string(b), err
    }
    
    // writeFile writes a file and returns an error if operation is unsuccessful.
    func writeFile(path string, data []byte) error {
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Tue Feb 20 22:39:28 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  4. cmd/bitrot-whole.go

    	tillOffset int64           // Affects the length of data requested in disk.ReadFile depending on Read()'s offset
    	buf        []byte          // Holds bit-rot verified data
    }
    
    func (b *wholeBitrotReader) ReadAt(buf []byte, offset int64) (n int, err error) {
    	if b.buf == nil {
    		b.buf = make([]byte, b.tillOffset-offset)
    		if _, err := b.disk.ReadFile(context.TODO(), b.volume, b.filePath, offset, b.buf, b.verifier); err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jan 31 02:11:45 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  5. operator/cmd/mesh/manifest-diff.go

    func compareManifestsFromFiles(args []string, verbose bool,
    	renameResources, selectResources, ignoreResources string,
    ) (bool, error) {
    	a, err := os.ReadFile(args[0])
    	if err != nil {
    		return false, fmt.Errorf("could not read %q: %v", args[0], err)
    	}
    	b, err := os.ReadFile(args[1])
    	if err != nil {
    		return false, fmt.Errorf("could not read %q: %v", args[1], err)
    	}
    
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Fri Mar 15 01:18:49 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  6. docs_src/generate_clients/tutorial004.js

    import * as fs from 'fs'
    
    async function modifyOpenAPIFile(filePath) {
      try {
        const data = await fs.promises.readFile(filePath)
        const openapiContent = JSON.parse(data)
    
        const paths = openapiContent.paths
        for (const pathKey of Object.keys(paths)) {
          const pathData = paths[pathKey]
          for (const method of Object.keys(pathData)) {
            const operation = pathData[method]
            if (operation.tags && operation.tags.length > 0) {
    JavaScript
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 14 11:40:05 GMT 2024
    - 1K bytes
    - Viewed (0)
  7. lib/time/mkzip.go

    	var zb bytes.Buffer
    	zw := zip.NewWriter(&zb)
    	seen := make(map[string]bool)
    	err := filepath.WalkDir(".", func(path string, d fs.DirEntry, err error) error {
    		if d.IsDir() {
    			return nil
    		}
    		data, err := os.ReadFile(path)
    		if err != nil {
    			log.Fatal(err)
    		}
    		if strings.HasSuffix(path, ".zip") {
    			log.Fatalf("unexpected file during walk: %s", path)
    		}
    		name := filepath.ToSlash(path)
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Mar 04 17:32:07 GMT 2024
    - 2.1K bytes
    - Viewed (0)
  8. cmd/storage-rest-common.go

    	storageRESTMethodWriteAll       = "/writeall"
    	storageRESTMethodReadVersion    = "/readversion"
    	storageRESTMethodReadXL         = "/readxl"
    	storageRESTMethodReadAll        = "/readall"
    	storageRESTMethodReadFile       = "/readfile"
    	storageRESTMethodReadFileStream = "/readfilestream"
    	storageRESTMethodListDir        = "/listdir"
    	storageRESTMethodDeleteVersions = "/deleteverions"
    	storageRESTMethodRenameFile     = "/renamefile"
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Feb 12 21:00:20 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  9. internal/store/queuestore.go

    	store.RLock()
    
    	defer func(store *QueueStore[I]) {
    		store.RUnlock()
    		if err != nil {
    			// Upon error we remove the entry.
    			store.Del(key)
    		}
    	}(store)
    
    	raw, err = os.ReadFile(filepath.Join(store.directory, key+store.fileExt))
    	if err != nil {
    		return
    	}
    
    	if len(raw) == 0 {
    		return raw, os.ErrNotExist
    	}
    
    	return
    }
    
    // Get - gets an item from the store.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Mar 25 16:44:20 GMT 2024
    - 7.1K bytes
    - Viewed (0)
  10. cmd/xl-storage-format-v2_test.go

    		if dataDir != tc.expectedDataDir {
    			t.Fatalf("Expected %s but got %s", tc.expectedDataDir, dataDir)
    		}
    		count++
    	}
    }
    
    func Benchmark_mergeXLV2Versions(b *testing.B) {
    	data, err := os.ReadFile("testdata/xl.meta-v1.2.zst")
    	if err != nil {
    		b.Fatal(err)
    	}
    	dec, _ := zstd.NewReader(nil)
    	data, err = dec.DecodeAll(data, nil)
    	if err != nil {
    		b.Fatal(err)
    	}
    
    	var xl xlMetaV2
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Mar 08 17:50:48 GMT 2024
    - 36.4K bytes
    - Viewed (0)
Back to top