Skip to content

Commit c156544

Browse files
committed
feat: expose closer for GetResponse
1 parent 6f324be commit c156544

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

gateway/gateway.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ type GetRange struct {
6666
type GetResponse struct {
6767
bytes files.File
6868
directoryMetadata *directoryMetadata
69+
closeFn func() error
70+
}
71+
72+
func (g *GetResponse) Close() error {
73+
if g.closeFn == nil {
74+
return nil
75+
}
76+
return g.closeFn()
77+
}
78+
79+
func (g *GetResponse) SetCloser(closeFn func() error) {
80+
g.closeFn = closeFn
6981
}
7082

7183
type directoryMetadata struct {

0 commit comments

Comments
 (0)