github.com/Schaudge/grailbase@v0.0.0-20240223061707-44c758a471c0/fileio/named_rw.go (about)

     1  // Copyright 2018 GRAIL, Inc. All rights reserved.
     2  // Use of this source code is governed by the Apache-2.0
     3  // license that can be found in the LICENSE file.
     4  
     5  package fileio
     6  
     7  import "io"
     8  
     9  // Reader is io.Reader with an additional Name method that returns
    10  // the name of the original source of the reader.
    11  type Reader interface {
    12  	io.Reader
    13  	Name() string
    14  }
    15  
    16  // ReadCloser is io.ReadCloser with an additional Name method that returns
    17  // the name of the original source of the reader.
    18  type ReadCloser interface {
    19  	io.ReadCloser
    20  	Name() string
    21  }
    22  
    23  // Writer is io.Writer with an additional Name method that returns
    24  // the name of the original source of the writer.
    25  type Writer interface {
    26  	io.Writer
    27  	Name() string
    28  }
    29  
    30  // WriteCloser is io.WriteCloser with an additional Name method that returns
    31  // the name of the original source of the writer.
    32  type WriteCloser interface {
    33  	io.WriteCloser
    34  	Name() string
    35  }
    36  
    37  // ReadWriteCloser is an interface that implements io.ReadWriteCloser with an
    38  // additional Name method that returns the name of the original source of the
    39  // writer.
    40  type ReadWriteCloser interface {
    41  	io.ReadWriteCloser
    42  	Name() string
    43  }
    44  
    45  // Closer is io.Closer with an additional Name method that returns
    46  // the name of the original source of the closer.
    47  type Closer interface {
    48  	io.Closer
    49  	Name() string
    50  }