mirror of
https://github.com/octoleo/restic.git
synced 2025-01-23 23:28:32 +00:00
s3: Move interfaces to function
This commit is contained in:
parent
3b44b87137
commit
250a45ab15
@ -81,17 +81,17 @@ func (be *s3) Location() string {
|
|||||||
return be.bucketname
|
return be.bucketname
|
||||||
}
|
}
|
||||||
|
|
||||||
type Sizer interface {
|
|
||||||
Size() int64
|
|
||||||
}
|
|
||||||
|
|
||||||
type Lenner interface {
|
|
||||||
Len() int
|
|
||||||
}
|
|
||||||
|
|
||||||
// getRemainingSize returns number of bytes remaining. If it is not possible to
|
// getRemainingSize returns number of bytes remaining. If it is not possible to
|
||||||
// determine the size, panic() is called.
|
// determine the size, panic() is called.
|
||||||
func getRemainingSize(rd io.Reader) (size int64, err error) {
|
func getRemainingSize(rd io.Reader) (size int64, err error) {
|
||||||
|
type Sizer interface {
|
||||||
|
Size() int64
|
||||||
|
}
|
||||||
|
|
||||||
|
type Lenner interface {
|
||||||
|
Len() int
|
||||||
|
}
|
||||||
|
|
||||||
if r, ok := rd.(Lenner); ok {
|
if r, ok := rd.(Lenner); ok {
|
||||||
size = int64(r.Len())
|
size = int64(r.Len())
|
||||||
} else if r, ok := rd.(Sizer); ok {
|
} else if r, ok := rd.(Sizer); ok {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user