feat: rename to yatm

This commit is contained in:
Samuel N Cui
2023-09-26 16:47:06 +08:00
parent efb352ba44
commit 508d4bf137
50 changed files with 72 additions and 70 deletions

View File

@@ -47,4 +47,4 @@ jobs:
files: |
LICENSE
README.md
tapemanager-linux-amd64-${{ env.RELEASE_VERSION }}.tar.gz
yatm-linux-amd64-${{ env.RELEASE_VERSION }}.tar.gz

View File

@@ -1 +1,3 @@
# tapemanager
# YATM aka Yet Another Tape Manager
## Install

View File

@@ -1,9 +1,9 @@
package apis
import (
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/tapemanager/executor"
"github.com/samuelncui/tapemanager/library"
"github.com/samuelncui/yatm/entity"
"github.com/samuelncui/yatm/executor"
"github.com/samuelncui/yatm/library"
)
var (

View File

@@ -6,9 +6,9 @@ import (
"path/filepath"
"time"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/tapemanager/executor"
"github.com/samuelncui/tapemanager/library"
"github.com/samuelncui/yatm/entity"
"github.com/samuelncui/yatm/executor"
"github.com/samuelncui/yatm/library"
)
func convertFiles(files ...*library.File) []*entity.File {

View File

@@ -3,7 +3,7 @@ package apis
import (
"context"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) DeviceList(ctx context.Context, req *entity.DeviceListRequest) (*entity.DeviceListReply, error) {

View File

@@ -4,7 +4,7 @@ import (
"context"
mapset "github.com/deckarep/golang-set/v2"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) FileDelete(ctx context.Context, req *entity.FileDeleteRequest) (*entity.FileDeleteReply, error) {

View File

@@ -7,7 +7,7 @@ import (
"path"
"strings"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) FileEdit(ctx context.Context, req *entity.FileEditRequest) (*entity.FileEditReply, error) {

View File

@@ -4,8 +4,8 @@ import (
"context"
"errors"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/tapemanager/library"
"github.com/samuelncui/yatm/entity"
"github.com/samuelncui/yatm/library"
)
func (api *API) FileGet(ctx context.Context, req *entity.FileGetRequest) (*entity.FileGetReply, error) {

View File

@@ -3,7 +3,7 @@ package apis
import (
"context"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) FileListParents(ctx context.Context, req *entity.FileListParentsRequest) (*entity.FileListParentsReply, error) {

View File

@@ -5,7 +5,7 @@ import (
"fmt"
"io/fs"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) FileMkdir(ctx context.Context, req *entity.FileMkdirRequest) (*entity.FileMkdirReply, error) {

View File

@@ -3,8 +3,8 @@ package apis
import (
"context"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/tapemanager/executor"
"github.com/samuelncui/yatm/entity"
"github.com/samuelncui/yatm/executor"
)
func (api *API) JobCreate(ctx context.Context, req *entity.JobCreateRequest) (*entity.JobCreateReply, error) {

View File

@@ -3,7 +3,7 @@ package apis
import (
"context"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) JobDelete(ctx context.Context, req *entity.JobDeleteRequest) (*entity.JobDeleteReply, error) {

View File

@@ -3,7 +3,7 @@ package apis
import (
"context"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
"github.com/sirupsen/logrus"
)

View File

@@ -5,7 +5,7 @@ import (
"fmt"
"io"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) JobGetLog(ctx context.Context, req *entity.JobGetLogRequest) (*entity.JobGetLogReply, error) {

View File

@@ -4,7 +4,7 @@ import (
"context"
"fmt"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) JobList(ctx context.Context, req *entity.JobListRequest) (*entity.JobListReply, error) {

View File

@@ -3,7 +3,7 @@ package apis
import (
"context"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) JobNext(ctx context.Context, req *entity.JobNextRequest) (*entity.JobNextReply, error) {

View File

@@ -3,7 +3,7 @@ package apis
import (
"context"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) LibraryExport(ctx context.Context, req *entity.LibraryExportRequest) (*entity.LibraryExportReply, error) {

View File

@@ -8,7 +8,7 @@ import (
"path"
"strings"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) SourceList(ctx context.Context, req *entity.SourceListRequest) (*entity.SourceListReply, error) {

View File

@@ -3,7 +3,7 @@ package apis
import (
"context"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (api *API) TapeDelete(ctx context.Context, req *entity.TapeDeleteRequest) (*entity.TapeDeleteReply, error) {

View File

@@ -5,8 +5,8 @@ import (
"fmt"
"github.com/samber/lo"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/tapemanager/library"
"github.com/samuelncui/yatm/entity"
"github.com/samuelncui/yatm/library"
)
func (api *API) TapeList(ctx context.Context, req *entity.TapeListRequest) (*entity.TapeListReply, error) {

View File

@@ -4,7 +4,7 @@ set -ex;
CURDIR=$(cd $(dirname $0); pwd);
cd ${CURDIR};
export TARGET_FILE="tapemanager-linux-amd64-${RELEASE_VERSION}.tar.gz"
export TARGET_FILE="yatm-linux-amd64-${RELEASE_VERSION}.tar.gz"
rm -rf output;
mkdir -p output;

View File

@@ -15,12 +15,12 @@ import (
"github.com/improbable-eng/grpc-web/go/grpcweb"
rotatelogs "github.com/lestrrat-go/file-rotatelogs"
"github.com/rifflock/lfshook"
"github.com/samuelncui/tapemanager/apis"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/tapemanager/executor"
"github.com/samuelncui/tapemanager/library"
"github.com/samuelncui/tapemanager/resource"
"github.com/samuelncui/tapemanager/tools"
"github.com/samuelncui/yatm/apis"
"github.com/samuelncui/yatm/entity"
"github.com/samuelncui/yatm/executor"
"github.com/samuelncui/yatm/library"
"github.com/samuelncui/yatm/resource"
"github.com/samuelncui/yatm/tools"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"

View File

@@ -1,13 +1,13 @@
[Unit]
Description=Tape Writer Service
Documentation=https://github.com/samuelncui/tapemanager/
Documentation=https://github.com/samuelncui/yatm/
After=network.target
[Service]
User=root
Type=simple
WorkingDirectory=/opt/tapemanager
ExecStart=/opt/tapemanager/httpd
WorkingDirectory=/opt/yatm
ExecStart=/opt/yatm/httpd
Restart=always
RestartSec=15
StartLimitInterval=0

View File

@@ -1,7 +1,7 @@
syntax = "proto3";
package copy_status;
option go_package = "github.com/samuelncui/tapemanager/entity";
option go_package = "github.com/samuelncui/yatm/entity";
enum CopyStatus {
DRAFT = 0;

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
package file;
option go_package = "github.com/samuelncui/tapemanager/entity";
option go_package = "github.com/samuelncui/yatm/entity";
message File {
int64 id = 1;

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
package job;
option go_package = "github.com/samuelncui/tapemanager/entity";
option go_package = "github.com/samuelncui/yatm/entity";
import "job_archive.proto";
import "job_restore.proto";

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
package job_archive;
option go_package = "github.com/samuelncui/tapemanager/entity";
option go_package = "github.com/samuelncui/yatm/entity";
import "source.proto";

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
package job_restore;
option go_package = "github.com/samuelncui/tapemanager/entity";
option go_package = "github.com/samuelncui/yatm/entity";
import "copy_status.proto";

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
package library_entity_type;
option go_package = "github.com/samuelncui/tapemanager/entity";
option go_package = "github.com/samuelncui/yatm/entity";
enum LibraryEntityType {
NONE = 0;

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
package position;
option go_package = "github.com/samuelncui/tapemanager/entity";
option go_package = "github.com/samuelncui/yatm/entity";
message Position {
int64 id = 1;

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
package service;
option go_package = "github.com/samuelncui/tapemanager/entity";
option go_package = "github.com/samuelncui/yatm/entity";
import "job.proto";
import "file.proto";

View File

@@ -1,7 +1,7 @@
syntax = "proto3";
package source;
option go_package = "github.com/samuelncui/tapemanager/entity";
option go_package = "github.com/samuelncui/yatm/entity";
import "copy_status.proto";

View File

@@ -1,6 +1,6 @@
syntax = "proto3";
package tape;
option go_package = "github.com/samuelncui/tapemanager/entity";
option go_package = "github.com/samuelncui/yatm/entity";
message Tape {
int64 id = 1;

View File

@@ -7,8 +7,8 @@ import (
"sync"
mapset "github.com/deckarep/golang-set/v2"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/tapemanager/library"
"github.com/samuelncui/yatm/entity"
"github.com/samuelncui/yatm/library"
"gorm.io/gorm"
)

View File

@@ -5,7 +5,7 @@ import (
"fmt"
"time"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
"gorm.io/gorm"
)

View File

@@ -4,7 +4,7 @@ import (
"context"
"sync/atomic"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (e *Executor) getArchiveDisplay(ctx context.Context, job *Job) (*entity.JobArchiveDisplay, error) {

View File

@@ -16,9 +16,9 @@ import (
mapset "github.com/deckarep/golang-set/v2"
"github.com/samber/lo"
"github.com/samuelncui/acp"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/tapemanager/library"
"github.com/samuelncui/tapemanager/tools"
"github.com/samuelncui/yatm/entity"
"github.com/samuelncui/yatm/library"
"github.com/samuelncui/yatm/tools"
"github.com/sirupsen/logrus"
)

View File

@@ -9,7 +9,7 @@ import (
"strings"
"github.com/samuelncui/acp"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (e *Executor) createArchive(ctx context.Context, job *Job, param *entity.JobArchiveParam) error {

View File

@@ -3,7 +3,7 @@ package executor
import (
"context"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (e *Executor) startArchive(ctx context.Context, job *Job) error {

View File

@@ -7,7 +7,7 @@ import (
"os/exec"
"time"
"github.com/samuelncui/tapemanager/library"
"github.com/samuelncui/yatm/library"
"github.com/sirupsen/logrus"
)

View File

@@ -4,7 +4,7 @@ import (
"context"
"sync/atomic"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (e *Executor) getRestoreDisplay(ctx context.Context, job *Job) (*entity.JobRestoreDisplay, error) {

View File

@@ -18,8 +18,8 @@ import (
jsoniter "github.com/json-iterator/go"
"github.com/samber/lo"
"github.com/samuelncui/acp"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/tapemanager/tools"
"github.com/samuelncui/yatm/entity"
"github.com/samuelncui/yatm/tools"
"github.com/sirupsen/logrus"
)

View File

@@ -9,9 +9,9 @@ import (
mapset "github.com/deckarep/golang-set/v2"
"github.com/samber/lo"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/tapemanager/library"
"github.com/samuelncui/tapemanager/tools"
"github.com/samuelncui/yatm/entity"
"github.com/samuelncui/yatm/library"
"github.com/samuelncui/yatm/tools"
"github.com/sirupsen/logrus"
)

View File

@@ -3,7 +3,7 @@ package executor
import (
"context"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
func (e *Executor) startRestore(ctx context.Context, job *Job) error {

View File

@@ -1,6 +1,6 @@
package external
import "github.com/samuelncui/tapemanager/library"
import "github.com/samuelncui/yatm/library"
type External struct {
lib *library.Library

View File

@@ -9,7 +9,7 @@ import (
"path"
"github.com/samuelncui/acp"
"github.com/samuelncui/tapemanager/library"
"github.com/samuelncui/yatm/library"
)
func (e *External) ImportACPReport(ctx context.Context, barname, name, encryption string, reader io.Reader) error {

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/samuelncui/tapemanager
module github.com/samuelncui/yatm
go 1.20

View File

@@ -7,7 +7,7 @@ import (
"github.com/modern-go/reflect2"
"github.com/samber/lo"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
"gorm.io/gorm"
)

View File

@@ -6,7 +6,7 @@ import (
"os"
"time"
"github.com/samuelncui/tapemanager/entity"
"github.com/samuelncui/yatm/entity"
)
var (

View File

@@ -3,7 +3,7 @@ package tapechanger
import (
"context"
"github.com/samuelncui/tapemanager/library"
"github.com/samuelncui/yatm/library"
)
var (