-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15079aa
commit 999b9bf
Showing
27 changed files
with
1,357 additions
and
358 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package apis | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/samuelncui/yatm/entity" | ||
) | ||
|
||
func (api *API) LibraryTrim(ctx context.Context, req *entity.LibraryTrimRequest) (*entity.LibraryTrimReply, error) { | ||
if err := api.lib.Trim(ctx, req.TrimPosition, req.TrimFile); err != nil { | ||
return nil, err | ||
} | ||
return &entity.LibraryTrimReply{}, nil | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package apis | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/samuelncui/yatm/entity" | ||
) | ||
|
||
func (api *API) TapeGetPositions(ctx context.Context, req *entity.TapeGetPositionsRequest) (*entity.TapeGetPositionsReply, error) { | ||
positions, err := api.lib.ListPositions(ctx, req.Id, req.Directory) | ||
if err != nil { | ||
return nil, fmt.Errorf("list position has error, %w", err) | ||
} | ||
|
||
return &entity.TapeGetPositionsReply{Positions: convertPositions(positions...)}, nil | ||
} |
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
Oops, something went wrong.