Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 59 for Writer (0.18 sec)

  1. cmd/erasure-encode.go

    import (
    	"context"
    	"fmt"
    	"io"
    	"sync"
    )
    
    // Writes in parallel to writers
    type parallelWriter struct {
    	writers     []io.Writer
    	writeQuorum int
    	errs        []error
    }
    
    // Write writes data to writers in parallel.
    func (p *parallelWriter) Write(ctx context.Context, blocks [][]byte) error {
    	var wg sync.WaitGroup
    
    	for i := range p.writers {
    		if p.writers[i] == nil {
    			p.errs[i] = errDiskNotFound
    			continue
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jan 31 02:11:45 GMT 2024
    - 3K bytes
    - Viewed (0)
  2. internal/ioutil/ioutil_test.go

    	}
    }
    
    func TestCloseOnWriter(t *testing.T) {
    	writer := WriteOnClose(io.Discard)
    	if writer.HasWritten() {
    		t.Error("WriteOnCloser must not be marked as HasWritten")
    	}
    	writer.Write(nil)
    	if !writer.HasWritten() {
    		t.Error("WriteOnCloser must be marked as HasWritten")
    	}
    
    	writer = WriteOnClose(io.Discard)
    	writer.Close()
    	if !writer.HasWritten() {
    		t.Error("WriteOnCloser must be marked as HasWritten")
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 02 11:02:31 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  3. internal/lsync/lrwmutex_test.go

    	lrwm := NewLRWMutex()
    
    	// fmt.Println("Getting initial write lock")
    	if !lrwm.GetLock(ctx, "", "", time.Second) {
    		panic("Failed to acquire initial write lock")
    	}
    
    	go func() {
    		time.Sleep(2 * time.Second)
    		lrwm.Unlock()
    		// fmt.Println("Initial write lock released, waiting...")
    	}()
    
    	// fmt.Println("Trying to acquire 2nd write lock, waiting...")
    	locked = lrwm.GetLock(ctx, "", "", duration)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Mar 05 04:57:35 GMT 2023
    - 7.9K bytes
    - Viewed (0)
  4. cmd/bitrot-streaming.go

    func newStreamingBitrotWriterBuffer(w io.Writer, algo BitrotAlgorithm, shardSize int64) io.Writer {
    	return &streamingBitrotWriter{iow: ioutil.NopCloser(w), h: algo.New(), shardSize: shardSize, canClose: nil, closeWithErr: func(err error) error {
    		// Similar to CloseWithError on pipes we always return nil.
    		return nil
    	}}
    }
    
    // Returns streaming bitrot writer implementation.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Jan 31 02:11:45 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  5. internal/s3select/json/record.go

    func (r *Record) Raw() (sql.SelectObjectFormat, interface{}) {
    	return r.SelectFormat, r.KVS
    }
    
    // WriteJSON - encodes to JSON data.
    func (r *Record) WriteJSON(writer io.Writer) error {
    	return json.NewEncoder(writer).Encode(r.KVS)
    }
    
    // Replace the underlying buffer of json data.
    func (r *Record) Replace(k interface{}) error {
    	v, ok := k.(jstream.KVS)
    	if !ok {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 25 20:31:19 GMT 2022
    - 5.2K bytes
    - Viewed (0)
  6. internal/dsync/drwmutex_test.go

    		runtime.GOMAXPROCS(gomaxprocs)
    		// Number of active readers + 10000 * number of active writers.
    		var activity int32
    		cdone := make(chan bool)
    		go writer(resource, numIterations, &activity, cdone)
    		var i int
    		for i = 0; i < numReaders/2; i++ {
    			go reader(resource, numIterations, &activity, cdone)
    		}
    		go writer(resource, numIterations, &activity, cdone)
    		for ; i < numReaders; i++ {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Dec 24 03:49:07 GMT 2022
    - 9.7K bytes
    - Viewed (0)
  7. cmd/erasure-decode.go

    }
    
    // Decode reads from readers, reconstructs data if needed and writes the data to the writer.
    // A set of preferred drives can be supplied. In that case they will be used and the data reconstructed.
    func (e Erasure) Decode(ctx context.Context, writer io.Writer, readers []io.ReaderAt, offset, length, totalLength int64, prefer []bool) (written int64, derr error) {
    	if offset < 0 || length < 0 {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 19 16:44:59 GMT 2024
    - 9.4K bytes
    - Viewed (0)
  8. docs/debugging/inspect/decrypt-v2.go

    package main
    
    import (
    	"errors"
    	"fmt"
    	"io"
    	"os"
    
    	"github.com/minio/madmin-go/v3/estream"
    )
    
    type keepFileErr struct {
    	error
    }
    
    func extractInspectV2(pk []byte, r io.Reader, w io.Writer, okMsg string) error {
    	privKey, err := bytesToPrivateKey(pk)
    	if err != nil {
    		return fmt.Errorf("decoding key returned: %w", err)
    	}
    
    	sr, err := estream.NewReader(r)
    	if err != nil {
    		return err
    	}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 11 21:22:47 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  9. internal/http/response-recorder.go

    		// Always logging error responses.
    		lrw.body.Write(p)
    	}
    	if err != nil {
    		return n, err
    	}
    	return n, err
    }
    
    // Write the headers into the given buffer
    func (lrw *ResponseRecorder) writeHeaders(w io.Writer, statusCode int, headers http.Header) {
    	n, _ := fmt.Fprintf(w, "%d %s\n", statusCode, http.StatusText(statusCode))
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Dec 02 00:13:19 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  10. cmd/main.go

    			for _, cmd := range closestCommands {
    				console.Printf("\t‘%s’\n", cmd)
    			}
    		}
    
    		os.Exit(1)
    	}
    
    	return app
    }
    
    func startupBanner(banner io.Writer) {
    	CopyrightYear = strconv.Itoa(time.Now().Year())
    	fmt.Fprintln(banner, color.Blue("Copyright:")+color.Bold(" 2015-%s MinIO, Inc.", CopyrightYear))
    	fmt.Fprintln(banner, color.Blue("License:")+color.Bold(" "+MinioLicense))
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Mar 09 03:07:08 GMT 2024
    - 6.4K bytes
    - Viewed (0)
Back to top