Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for WriteOnClose (0.2 sec)

  1. 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() {
    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)
  2. internal/ioutil/ioutil.go

    	}
    	return nil
    }
    
    // HasWritten returns true if at least one write operation was performed.
    func (w *WriteOnCloser) HasWritten() bool { return w.hasWritten }
    
    // WriteOnClose takes an io.Writer and returns an ioutil.WriteOnCloser.
    func WriteOnClose(w io.Writer) *WriteOnCloser {
    	return &WriteOnCloser{w, false}
    }
    
    type ioret[V any] struct {
    	val V
    	err error
    }
    
    // DeadlineWriter deadline writer with timeout
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 11:26:59 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  3. cmd/s3-zip-handlers.go

    		writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
    		return
    	}
    	// s3zip does not allow ranges
    	w.Header().Del(xhttp.AcceptRanges)
    
    	setHeadGetRespHeaders(w, r.Form)
    
    	httpWriter := xioutil.WriteOnClose(w)
    
    	// Write object content to response body
    	if _, err = xioutil.Copy(httpWriter, rc); err != nil {
    		if !httpWriter.HasWritten() {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Apr 09 10:41:25 GMT 2024
    - 15.8K bytes
    - Viewed (0)
  4. cmd/object-handlers.go

    	}
    
    	setHeadGetRespHeaders(w, r.Form)
    
    	var iw io.Writer
    	iw = w
    	if buf != nil {
    		iw = io.MultiWriter(w, buf)
    	}
    
    	statusCodeWritten := false
    	httpWriter := xioutil.WriteOnClose(iw)
    	if rs != nil || opts.PartNumber > 0 {
    		statusCodeWritten = true
    		w.WriteHeader(http.StatusPartialContent)
    	}
    
    	// Write object content to response body
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 22 17:49:30 GMT 2024
    - 125K bytes
    - Viewed (0)
Back to top