-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use reader embedded in a no-op closer.
- Loading branch information
Showing
8 changed files
with
48 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,32 @@ | ||
package io | ||
|
||
import "io" | ||
import ( | ||
"io" | ||
|
||
"github.com/m3db/m3x/close" | ||
) | ||
|
||
// Reader embeds both `io.Reader` and `io.ByteReader`. | ||
type Reader interface { | ||
io.Reader | ||
io.ByteReader | ||
} | ||
|
||
// SimpleReadCloser embeds both `Reader` and `close.SimpleCloser`. | ||
type SimpleReadCloser interface { | ||
Reader | ||
close.SimpleCloser | ||
} | ||
|
||
// ReaderNoopCloser is a reader that has a no-op Close method. | ||
type ReaderNoopCloser struct { | ||
Reader | ||
} | ||
|
||
// NewReaderNoopCloser returns a new reader that implements a no-op Close. | ||
func NewReaderNoopCloser(r Reader) SimpleReadCloser { | ||
return ReaderNoopCloser{Reader: r} | ||
} | ||
|
||
// Close is a no-op. | ||
func (r ReaderNoopCloser) Close() {} |