Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 69 for Writer (0.2 sec)

  1. internal/ioutil/ioutil.go

    // executes at least one write operation if it is closed.
    //
    // This can be useful within the context of HTTP. At least
    // one write operation must happen to send the HTTP headers
    // to the peer.
    type WriteOnCloser struct {
    	io.Writer
    	hasWritten bool
    }
    
    func (w *WriteOnCloser) Write(p []byte) (int, error) {
    	w.hasWritten = true
    	return w.Writer.Write(p)
    }
    
    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)
  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. cmd/bucket-handlers_test.go

    	// if object upload fails stop the test.
    	if err != nil {
    		t.Fatalf("Error uploading object: <ERROR> %v", err)
    	}
    
    	// initialize httptest Recorder, this records any mutations to response writer inside the handler.
    	rec := httptest.NewRecorder()
    	// construct HTTP request for DELETE bucket.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 39.5K bytes
    - Viewed (2)
  4. cmd/metacache-walk.go

    // On success a sorted meta cache stream will be returned.
    // Metadata has data stripped, if any.
    func (s *xlStorage) WalkDir(ctx context.Context, opts WalkDirOptions, wr io.Writer) (err error) {
    	legacyFS := !(s.fsType == xfs || s.fsType == ext4)
    
    	s.RLock()
    	legacy := s.formatLegacy
    	s.RUnlock()
    
    	// Verify if volume is valid and it exists.
    	volumeDir, err := s.getVolDir(opts.Bucket)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 12.4K bytes
    - Viewed (0)
  5. cmd/bucket-replication-utils_gen.go

    // EncodeMsg implements msgp.Encodable
    func (z *BucketReplicationResyncStatus) EncodeMsg(en *msgp.Writer) (err error) {
    	// map header, size 4
    	// write "v"
    	err = en.Append(0x84, 0xa1, 0x76)
    	if err != nil {
    		return
    	}
    	err = en.WriteInt(z.Version)
    	if err != nil {
    		err = msgp.WrapError(err, "Version")
    		return
    	}
    	// write "brs"
    	err = en.Append(0xa3, 0x62, 0x72, 0x73)
    	if err != nil {
    		return
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Mar 21 17:21:35 GMT 2024
    - 61.1K bytes
    - Viewed (0)
  6. cmd/metacache-stream.go

    		}
    		return nil
    	}
    	return &w
    }
    
    // write one or more objects to the stream in order.
    // It is favorable to send as many objects as possible in a single write,
    // but no more than math.MaxUint32
    func (w *metacacheWriter) write(objs ...metaCacheEntry) error {
    	if w == nil {
    		return errors.New("metacacheWriter: nil writer")
    	}
    	if len(objs) == 0 {
    		return nil
    	}
    	if w.creator != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 19.5K bytes
    - Viewed (0)
  7. cmd/object-api-interface.go

    // tests are adjusted to use GetObjectNInfo this function can be removed.
    func GetObject(ctx context.Context, api ObjectLayer, bucket, object string, startOffset int64, length int64, writer io.Writer, etag string, opts ObjectOptions) (err error) {
    	var header http.Header
    	if etag != "" {
    		header.Set("ETag", etag)
    	}
    	Range := &HTTPRangeSpec{Start: startOffset, End: startOffset + length}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Apr 20 09:05:54 GMT 2024
    - 16.9K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. cmd/local-locker.go

    		return true, nil
    	}
    	if isWriteLock(lri) {
    		// A write-lock is held, cannot release a read lock
    		return false, fmt.Errorf("RUnlock attempted on a write locked entity: %s", resource)
    	}
    	l.removeEntry(resource, args, &lri)
    	return reply, nil
    }
    
    type lockStats struct {
    	Total  int
    	Writes int
    	Reads  int
    }
    
    func (l *localLocker) stats() lockStats {
    	l.mutex.Lock()
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Feb 19 22:54:46 GMT 2024
    - 10.6K bytes
    - Viewed (0)
Back to top