Skip to content

Commit

Permalink
cmd/uplink/ulfs: rename type
Browse files Browse the repository at this point in the history
Change-Id: I6f9c700283f977ca01fd3f69a12c9ae6e2ae6a5c
  • Loading branch information
egonelbre authored and Storj Robot committed Jan 22, 2024
1 parent e3b7a6d commit 00d4cdb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/uplink/ulfs/handle_uplink.go
Expand Up @@ -217,7 +217,7 @@ func (u *uplinkMultiWriteHandle) NextPart(ctx context.Context, length int64) (Wr
return nil, err
}

return &uplinkWriteHandle{
return &uplinkPartWriteHandle{
ul: ul,
tail: length < 0,
len: length,
Expand Down Expand Up @@ -258,14 +258,14 @@ func (u *uplinkMultiWriteHandle) Abort(ctx context.Context) error {
return err
}

// uplinkWriteHandle implements writeHandle for *uplink.Uploads.
type uplinkWriteHandle struct {
// uplinkPartWriteHandle implements writeHandle for *uplink.Uploads.
type uplinkPartWriteHandle struct {
ul *uplink.PartUpload
tail bool
len int64
}

func (u *uplinkWriteHandle) Write(p []byte) (int, error) {
func (u *uplinkPartWriteHandle) Write(p []byte) (int, error) {
if !u.tail {
if u.len <= 0 {
return 0, errs.New("write past maximum length")
Expand All @@ -283,10 +283,10 @@ func (u *uplinkWriteHandle) Write(p []byte) (int, error) {
return n, err
}

func (u *uplinkWriteHandle) Commit() error {
func (u *uplinkPartWriteHandle) Commit() error {
return u.ul.Commit()
}

func (u *uplinkWriteHandle) Abort() error {
func (u *uplinkPartWriteHandle) Abort() error {
return u.ul.Abort()
}

0 comments on commit 00d4cdb

Please sign in to comment.