mirror of
https://github.com/samuelncui/yatm.git
synced 2026-09-20 15:04:21 +00:00
feat: useable
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.10
|
||||
// source: copy_status.proto
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type CopyStatus int32
|
||||
|
||||
const (
|
||||
CopyStatus_Draft CopyStatus = 0
|
||||
CopyStatus_Pending CopyStatus = 1 // waiting in queue
|
||||
CopyStatus_Running CopyStatus = 2
|
||||
CopyStatus_Staged CopyStatus = 3
|
||||
CopyStatus_Submited CopyStatus = 4
|
||||
CopyStatus_Failed CopyStatus = 255
|
||||
)
|
||||
|
||||
// Enum value maps for CopyStatus.
|
||||
var (
|
||||
CopyStatus_name = map[int32]string{
|
||||
0: "Draft",
|
||||
1: "Pending",
|
||||
2: "Running",
|
||||
3: "Staged",
|
||||
4: "Submited",
|
||||
255: "Failed",
|
||||
}
|
||||
CopyStatus_value = map[string]int32{
|
||||
"Draft": 0,
|
||||
"Pending": 1,
|
||||
"Running": 2,
|
||||
"Staged": 3,
|
||||
"Submited": 4,
|
||||
"Failed": 255,
|
||||
}
|
||||
)
|
||||
|
||||
func (x CopyStatus) Enum() *CopyStatus {
|
||||
p := new(CopyStatus)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x CopyStatus) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (CopyStatus) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_copy_status_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (CopyStatus) Type() protoreflect.EnumType {
|
||||
return &file_copy_status_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x CopyStatus) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CopyStatus.Descriptor instead.
|
||||
func (CopyStatus) EnumDescriptor() ([]byte, []int) {
|
||||
return file_copy_status_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
var File_copy_status_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_copy_status_proto_rawDesc = []byte{
|
||||
0x0a, 0x11, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x2a, 0x58, 0x0a, 0x0a, 0x43, 0x6f, 0x70, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x09,
|
||||
0x0a, 0x05, 0x44, 0x72, 0x61, 0x66, 0x74, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x65, 0x6e,
|
||||
0x64, 0x69, 0x6e, 0x67, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e,
|
||||
0x67, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x67, 0x65, 0x64, 0x10, 0x03, 0x12,
|
||||
0x0c, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x10, 0x04, 0x12, 0x0b, 0x0a,
|
||||
0x06, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10, 0xff, 0x01, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x63, 0x39, 0x35, 0x30, 0x33,
|
||||
0x30, 0x39, 0x2f, 0x74, 0x61, 0x70, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x2f, 0x65, 0x6e,
|
||||
0x74, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_copy_status_proto_rawDescOnce sync.Once
|
||||
file_copy_status_proto_rawDescData = file_copy_status_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_copy_status_proto_rawDescGZIP() []byte {
|
||||
file_copy_status_proto_rawDescOnce.Do(func() {
|
||||
file_copy_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_copy_status_proto_rawDescData)
|
||||
})
|
||||
return file_copy_status_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_copy_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_copy_status_proto_goTypes = []interface{}{
|
||||
(CopyStatus)(0), // 0: copy_status.CopyStatus
|
||||
}
|
||||
var file_copy_status_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_copy_status_proto_init() }
|
||||
func file_copy_status_proto_init() {
|
||||
if File_copy_status_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_copy_status_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_copy_status_proto_goTypes,
|
||||
DependencyIndexes: file_copy_status_proto_depIdxs,
|
||||
EnumInfos: file_copy_status_proto_enumTypes,
|
||||
}.Build()
|
||||
File_copy_status_proto = out.File
|
||||
file_copy_status_proto_rawDesc = nil
|
||||
file_copy_status_proto_goTypes = nil
|
||||
file_copy_status_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
package copy_status;
|
||||
|
||||
option go_package = "github.com/abc950309/tapewriter/entity";
|
||||
|
||||
enum CopyStatus {
|
||||
Draft = 0;
|
||||
Pending = 1; // waiting in queue
|
||||
Running = 2;
|
||||
Staged = 3;
|
||||
Submited = 4;
|
||||
|
||||
Failed = 255;
|
||||
}
|
||||
@@ -0,0 +1,274 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.10
|
||||
// source: file.proto
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type File struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
ParentId int64 `protobuf:"varint,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Mode int64 `protobuf:"varint,17,opt,name=mode,proto3" json:"mode,omitempty"`
|
||||
ModTime int64 `protobuf:"varint,18,opt,name=mod_time,json=modTime,proto3" json:"mod_time,omitempty"`
|
||||
Size int64 `protobuf:"varint,19,opt,name=size,proto3" json:"size,omitempty"`
|
||||
Hash []byte `protobuf:"bytes,20,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||
}
|
||||
|
||||
func (x *File) Reset() {
|
||||
*x = File{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_file_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *File) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*File) ProtoMessage() {}
|
||||
|
||||
func (x *File) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_file_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use File.ProtoReflect.Descriptor instead.
|
||||
func (*File) Descriptor() ([]byte, []int) {
|
||||
return file_file_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *File) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *File) GetParentId() int64 {
|
||||
if x != nil {
|
||||
return x.ParentId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *File) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *File) GetMode() int64 {
|
||||
if x != nil {
|
||||
return x.Mode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *File) GetModTime() int64 {
|
||||
if x != nil {
|
||||
return x.ModTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *File) GetSize() int64 {
|
||||
if x != nil {
|
||||
return x.Size
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *File) GetHash() []byte {
|
||||
if x != nil {
|
||||
return x.Hash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type EditedFile struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ParentId *int64 `protobuf:"varint,2,opt,name=parent_id,json=parentId,proto3,oneof" json:"parent_id,omitempty"`
|
||||
Name *string `protobuf:"bytes,3,opt,name=name,proto3,oneof" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *EditedFile) Reset() {
|
||||
*x = EditedFile{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_file_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *EditedFile) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EditedFile) ProtoMessage() {}
|
||||
|
||||
func (x *EditedFile) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_file_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EditedFile.ProtoReflect.Descriptor instead.
|
||||
func (*EditedFile) Descriptor() ([]byte, []int) {
|
||||
return file_file_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *EditedFile) GetParentId() int64 {
|
||||
if x != nil && x.ParentId != nil {
|
||||
return *x.ParentId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *EditedFile) GetName() string {
|
||||
if x != nil && x.Name != nil {
|
||||
return *x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_file_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_file_proto_rawDesc = []byte{
|
||||
0x0a, 0x0a, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x66, 0x69,
|
||||
0x6c, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70,
|
||||
0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
|
||||
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x6d, 0x6f, 0x64, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65,
|
||||
0x12, 0x19, 0x0a, 0x08, 0x6d, 0x6f, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x12, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73,
|
||||
0x69, 0x7a, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68,
|
||||
0x61, 0x73, 0x68, 0x22, 0x5e, 0x0a, 0x0a, 0x45, 0x64, 0x69, 0x74, 0x65, 0x64, 0x46, 0x69, 0x6c,
|
||||
0x65, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64,
|
||||
0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x09, 0x48, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a,
|
||||
0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x61, 0x62, 0x63, 0x39, 0x35, 0x30, 0x33, 0x30, 0x39, 0x2f, 0x74, 0x61, 0x70, 0x65,
|
||||
0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_file_proto_rawDescOnce sync.Once
|
||||
file_file_proto_rawDescData = file_file_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_file_proto_rawDescGZIP() []byte {
|
||||
file_file_proto_rawDescOnce.Do(func() {
|
||||
file_file_proto_rawDescData = protoimpl.X.CompressGZIP(file_file_proto_rawDescData)
|
||||
})
|
||||
return file_file_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_file_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_file_proto_goTypes = []interface{}{
|
||||
(*File)(nil), // 0: file.File
|
||||
(*EditedFile)(nil), // 1: file.EditedFile
|
||||
}
|
||||
var file_file_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_file_proto_init() }
|
||||
func file_file_proto_init() {
|
||||
if File_file_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_file_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*File); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_file_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*EditedFile); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_file_proto_msgTypes[1].OneofWrappers = []interface{}{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_file_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_file_proto_goTypes,
|
||||
DependencyIndexes: file_file_proto_depIdxs,
|
||||
MessageInfos: file_file_proto_msgTypes,
|
||||
}.Build()
|
||||
File_file_proto = out.File
|
||||
file_file_proto_rawDesc = nil
|
||||
file_file_proto_goTypes = nil
|
||||
file_file_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
package file;
|
||||
option go_package = "github.com/abc950309/tapewriter/entity";
|
||||
|
||||
message File {
|
||||
int64 id = 1;
|
||||
int64 parent_id = 2;
|
||||
string name = 3;
|
||||
|
||||
int64 mode = 17;
|
||||
int64 mod_time = 18;
|
||||
int64 size = 19;
|
||||
bytes hash = 20;
|
||||
}
|
||||
|
||||
message EditedFile {
|
||||
optional int64 parent_id = 2;
|
||||
optional string name = 3;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"database/sql/driver"
|
||||
)
|
||||
|
||||
var (
|
||||
_ = sql.Scanner(&JobParam{})
|
||||
_ = driver.Valuer(&JobParam{})
|
||||
)
|
||||
|
||||
func (x *JobParam) Scan(src any) error {
|
||||
return Scan(x, src)
|
||||
}
|
||||
|
||||
func (x *JobParam) Value() (driver.Value, error) {
|
||||
return Value(x)
|
||||
}
|
||||
|
||||
var (
|
||||
_ = sql.Scanner(&JobState{})
|
||||
_ = driver.Valuer(&JobState{})
|
||||
)
|
||||
|
||||
func (x *JobState) Scan(src any) error {
|
||||
return Scan(x, src)
|
||||
}
|
||||
|
||||
func (x *JobState) Value() (driver.Value, error) {
|
||||
return Value(x)
|
||||
}
|
||||
@@ -0,0 +1,782 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.10
|
||||
// source: job.proto
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type JobStatus int32
|
||||
|
||||
const (
|
||||
JobStatus_Draft JobStatus = 0
|
||||
JobStatus_NotReady JobStatus = 1 // dependencies not satisfied
|
||||
JobStatus_Pending JobStatus = 2 // waiting in queue
|
||||
JobStatus_Processing JobStatus = 3
|
||||
JobStatus_Completed JobStatus = 4
|
||||
JobStatus_Failed JobStatus = 255
|
||||
)
|
||||
|
||||
// Enum value maps for JobStatus.
|
||||
var (
|
||||
JobStatus_name = map[int32]string{
|
||||
0: "Draft",
|
||||
1: "NotReady",
|
||||
2: "Pending",
|
||||
3: "Processing",
|
||||
4: "Completed",
|
||||
255: "Failed",
|
||||
}
|
||||
JobStatus_value = map[string]int32{
|
||||
"Draft": 0,
|
||||
"NotReady": 1,
|
||||
"Pending": 2,
|
||||
"Processing": 3,
|
||||
"Completed": 4,
|
||||
"Failed": 255,
|
||||
}
|
||||
)
|
||||
|
||||
func (x JobStatus) Enum() *JobStatus {
|
||||
p := new(JobStatus)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x JobStatus) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (JobStatus) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_job_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (JobStatus) Type() protoreflect.EnumType {
|
||||
return &file_job_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x JobStatus) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobStatus.Descriptor instead.
|
||||
func (JobStatus) EnumDescriptor() ([]byte, []int) {
|
||||
return file_job_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type Job struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Status JobStatus `protobuf:"varint,2,opt,name=status,proto3,enum=job.JobStatus" json:"status,omitempty"`
|
||||
Priority int64 `protobuf:"varint,3,opt,name=priority,proto3" json:"priority,omitempty"`
|
||||
CreateTime int64 `protobuf:"varint,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
|
||||
UpdateTime int64 `protobuf:"varint,5,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
|
||||
State *JobState `protobuf:"bytes,17,opt,name=state,proto3" json:"state,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Job) Reset() {
|
||||
*x = Job{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Job) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Job) ProtoMessage() {}
|
||||
|
||||
func (x *Job) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Job.ProtoReflect.Descriptor instead.
|
||||
func (*Job) Descriptor() ([]byte, []int) {
|
||||
return file_job_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Job) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Job) GetStatus() JobStatus {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return JobStatus_Draft
|
||||
}
|
||||
|
||||
func (x *Job) GetPriority() int64 {
|
||||
if x != nil {
|
||||
return x.Priority
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Job) GetCreateTime() int64 {
|
||||
if x != nil {
|
||||
return x.CreateTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Job) GetUpdateTime() int64 {
|
||||
if x != nil {
|
||||
return x.UpdateTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Job) GetState() *JobState {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type JobParam struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to Param:
|
||||
// *JobParam_Archive
|
||||
Param isJobParam_Param `protobuf_oneof:"param"`
|
||||
}
|
||||
|
||||
func (x *JobParam) Reset() {
|
||||
*x = JobParam{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobParam) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobParam) ProtoMessage() {}
|
||||
|
||||
func (x *JobParam) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobParam.ProtoReflect.Descriptor instead.
|
||||
func (*JobParam) Descriptor() ([]byte, []int) {
|
||||
return file_job_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (m *JobParam) GetParam() isJobParam_Param {
|
||||
if m != nil {
|
||||
return m.Param
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JobParam) GetArchive() *JobParamArchive {
|
||||
if x, ok := x.GetParam().(*JobParam_Archive); ok {
|
||||
return x.Archive
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isJobParam_Param interface {
|
||||
isJobParam_Param()
|
||||
}
|
||||
|
||||
type JobParam_Archive struct {
|
||||
Archive *JobParamArchive `protobuf:"bytes,1,opt,name=Archive,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*JobParam_Archive) isJobParam_Param() {}
|
||||
|
||||
type JobState struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to State:
|
||||
// *JobState_Archive
|
||||
State isJobState_State `protobuf_oneof:"state"`
|
||||
}
|
||||
|
||||
func (x *JobState) Reset() {
|
||||
*x = JobState{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobState) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobState) ProtoMessage() {}
|
||||
|
||||
func (x *JobState) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobState.ProtoReflect.Descriptor instead.
|
||||
func (*JobState) Descriptor() ([]byte, []int) {
|
||||
return file_job_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (m *JobState) GetState() isJobState_State {
|
||||
if m != nil {
|
||||
return m.State
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JobState) GetArchive() *JobStateArchive {
|
||||
if x, ok := x.GetState().(*JobState_Archive); ok {
|
||||
return x.Archive
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isJobState_State interface {
|
||||
isJobState_State()
|
||||
}
|
||||
|
||||
type JobState_Archive struct {
|
||||
Archive *JobStateArchive `protobuf:"bytes,1,opt,name=Archive,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*JobState_Archive) isJobState_State() {}
|
||||
|
||||
type JobNextParam struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to Param:
|
||||
// *JobNextParam_Archive
|
||||
Param isJobNextParam_Param `protobuf_oneof:"param"`
|
||||
}
|
||||
|
||||
func (x *JobNextParam) Reset() {
|
||||
*x = JobNextParam{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobNextParam) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobNextParam) ProtoMessage() {}
|
||||
|
||||
func (x *JobNextParam) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobNextParam.ProtoReflect.Descriptor instead.
|
||||
func (*JobNextParam) Descriptor() ([]byte, []int) {
|
||||
return file_job_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (m *JobNextParam) GetParam() isJobNextParam_Param {
|
||||
if m != nil {
|
||||
return m.Param
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JobNextParam) GetArchive() *JobArchiveNextParam {
|
||||
if x, ok := x.GetParam().(*JobNextParam_Archive); ok {
|
||||
return x.Archive
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isJobNextParam_Param interface {
|
||||
isJobNextParam_Param()
|
||||
}
|
||||
|
||||
type JobNextParam_Archive struct {
|
||||
Archive *JobArchiveNextParam `protobuf:"bytes,1,opt,name=archive,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*JobNextParam_Archive) isJobNextParam_Param() {}
|
||||
|
||||
type CreatableJob struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Priority int64 `protobuf:"varint,3,opt,name=priority,proto3" json:"priority,omitempty"`
|
||||
Param *JobParam `protobuf:"bytes,17,opt,name=param,proto3" json:"param,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CreatableJob) Reset() {
|
||||
*x = CreatableJob{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CreatableJob) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CreatableJob) ProtoMessage() {}
|
||||
|
||||
func (x *CreatableJob) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CreatableJob.ProtoReflect.Descriptor instead.
|
||||
func (*CreatableJob) Descriptor() ([]byte, []int) {
|
||||
return file_job_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *CreatableJob) GetPriority() int64 {
|
||||
if x != nil {
|
||||
return x.Priority
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CreatableJob) GetParam() *JobParam {
|
||||
if x != nil {
|
||||
return x.Param
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type JobFilter struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Status *JobStatus `protobuf:"varint,1,opt,name=status,proto3,enum=job.JobStatus,oneof" json:"status,omitempty"`
|
||||
Limit *int64 `protobuf:"varint,33,opt,name=limit,proto3,oneof" json:"limit,omitempty"`
|
||||
Offset *int64 `protobuf:"varint,34,opt,name=offset,proto3,oneof" json:"offset,omitempty"`
|
||||
}
|
||||
|
||||
func (x *JobFilter) Reset() {
|
||||
*x = JobFilter{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobFilter) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobFilter) ProtoMessage() {}
|
||||
|
||||
func (x *JobFilter) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobFilter.ProtoReflect.Descriptor instead.
|
||||
func (*JobFilter) Descriptor() ([]byte, []int) {
|
||||
return file_job_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *JobFilter) GetStatus() JobStatus {
|
||||
if x != nil && x.Status != nil {
|
||||
return *x.Status
|
||||
}
|
||||
return JobStatus_Draft
|
||||
}
|
||||
|
||||
func (x *JobFilter) GetLimit() int64 {
|
||||
if x != nil && x.Limit != nil {
|
||||
return *x.Limit
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *JobFilter) GetOffset() int64 {
|
||||
if x != nil && x.Offset != nil {
|
||||
return *x.Offset
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type JobDisplay struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to Display:
|
||||
// *JobDisplay_Archive
|
||||
Display isJobDisplay_Display `protobuf_oneof:"display"`
|
||||
}
|
||||
|
||||
func (x *JobDisplay) Reset() {
|
||||
*x = JobDisplay{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobDisplay) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobDisplay) ProtoMessage() {}
|
||||
|
||||
func (x *JobDisplay) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobDisplay.ProtoReflect.Descriptor instead.
|
||||
func (*JobDisplay) Descriptor() ([]byte, []int) {
|
||||
return file_job_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (m *JobDisplay) GetDisplay() isJobDisplay_Display {
|
||||
if m != nil {
|
||||
return m.Display
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JobDisplay) GetArchive() *JobDisplayArchive {
|
||||
if x, ok := x.GetDisplay().(*JobDisplay_Archive); ok {
|
||||
return x.Archive
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isJobDisplay_Display interface {
|
||||
isJobDisplay_Display()
|
||||
}
|
||||
|
||||
type JobDisplay_Archive struct {
|
||||
Archive *JobDisplayArchive `protobuf:"bytes,1,opt,name=archive,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*JobDisplay_Archive) isJobDisplay_Display() {}
|
||||
|
||||
var File_job_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_job_proto_rawDesc = []byte{
|
||||
0x0a, 0x09, 0x6a, 0x6f, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x6a, 0x6f, 0x62,
|
||||
0x1a, 0x11, 0x6a, 0x6f, 0x62, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0xc0, 0x01, 0x0a, 0x03, 0x4a, 0x6f, 0x62, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x73,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x6a, 0x6f,
|
||||
0x62, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12,
|
||||
0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
|
||||
0x65, 0x12, 0x23, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x0d, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52,
|
||||
0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x4d, 0x0a, 0x08, 0x4a, 0x6f, 0x62, 0x50, 0x61, 0x72,
|
||||
0x61, 0x6d, 0x12, 0x38, 0x0a, 0x07, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6a, 0x6f, 0x62, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76,
|
||||
0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76,
|
||||
0x65, 0x48, 0x00, 0x52, 0x07, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x42, 0x07, 0x0a, 0x05,
|
||||
0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x4d, 0x0a, 0x08, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74,
|
||||
0x65, 0x12, 0x38, 0x0a, 0x07, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6a, 0x6f, 0x62, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65,
|
||||
0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65,
|
||||
0x48, 0x00, 0x52, 0x07, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x73,
|
||||
0x74, 0x61, 0x74, 0x65, 0x22, 0x55, 0x0a, 0x0c, 0x4a, 0x6f, 0x62, 0x4e, 0x65, 0x78, 0x74, 0x50,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x12, 0x3c, 0x0a, 0x07, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6a, 0x6f, 0x62, 0x5f, 0x61, 0x72, 0x63, 0x68,
|
||||
0x69, 0x76, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x4e, 0x65,
|
||||
0x78, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x48, 0x00, 0x52, 0x07, 0x61, 0x72, 0x63, 0x68, 0x69,
|
||||
0x76, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x4f, 0x0a, 0x0c, 0x43,
|
||||
0x72, 0x65, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4a, 0x6f, 0x62, 0x12, 0x1a, 0x0a, 0x08, 0x70,
|
||||
0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70,
|
||||
0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d,
|
||||
0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x6a, 0x6f, 0x62, 0x2e, 0x4a, 0x6f, 0x62,
|
||||
0x50, 0x61, 0x72, 0x61, 0x6d, 0x52, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x90, 0x01, 0x0a,
|
||||
0x09, 0x4a, 0x6f, 0x62, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x06, 0x73, 0x74,
|
||||
0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x6a, 0x6f, 0x62,
|
||||
0x2e, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74,
|
||||
0x61, 0x74, 0x75, 0x73, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74,
|
||||
0x18, 0x21, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x88,
|
||||
0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x22, 0x20, 0x01,
|
||||
0x28, 0x03, 0x48, 0x02, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x88, 0x01, 0x01, 0x42,
|
||||
0x09, 0x0a, 0x07, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6c,
|
||||
0x69, 0x6d, 0x69, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22,
|
||||
0x53, 0x0a, 0x0a, 0x4a, 0x6f, 0x62, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x12, 0x3a, 0x0a,
|
||||
0x07, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e,
|
||||
0x2e, 0x6a, 0x6f, 0x62, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x4a, 0x6f, 0x62,
|
||||
0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x48, 0x00,
|
||||
0x52, 0x07, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x64, 0x69, 0x73,
|
||||
0x70, 0x6c, 0x61, 0x79, 0x2a, 0x5d, 0x0a, 0x09, 0x4a, 0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x75,
|
||||
0x73, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x72, 0x61, 0x66, 0x74, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08,
|
||||
0x4e, 0x6f, 0x74, 0x52, 0x65, 0x61, 0x64, 0x79, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x65,
|
||||
0x6e, 0x64, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x63, 0x65,
|
||||
0x73, 0x73, 0x69, 0x6e, 0x67, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x6f, 0x6d, 0x70, 0x6c,
|
||||
0x65, 0x74, 0x65, 0x64, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x06, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64,
|
||||
0x10, 0xff, 0x01, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x61, 0x62, 0x63, 0x39, 0x35, 0x30, 0x33, 0x30, 0x39, 0x2f, 0x74, 0x61, 0x70, 0x65,
|
||||
0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_job_proto_rawDescOnce sync.Once
|
||||
file_job_proto_rawDescData = file_job_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_job_proto_rawDescGZIP() []byte {
|
||||
file_job_proto_rawDescOnce.Do(func() {
|
||||
file_job_proto_rawDescData = protoimpl.X.CompressGZIP(file_job_proto_rawDescData)
|
||||
})
|
||||
return file_job_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_job_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_job_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_job_proto_goTypes = []interface{}{
|
||||
(JobStatus)(0), // 0: job.JobStatus
|
||||
(*Job)(nil), // 1: job.Job
|
||||
(*JobParam)(nil), // 2: job.JobParam
|
||||
(*JobState)(nil), // 3: job.JobState
|
||||
(*JobNextParam)(nil), // 4: job.JobNextParam
|
||||
(*CreatableJob)(nil), // 5: job.CreatableJob
|
||||
(*JobFilter)(nil), // 6: job.JobFilter
|
||||
(*JobDisplay)(nil), // 7: job.JobDisplay
|
||||
(*JobParamArchive)(nil), // 8: job_archive.JobParamArchive
|
||||
(*JobStateArchive)(nil), // 9: job_archive.JobStateArchive
|
||||
(*JobArchiveNextParam)(nil), // 10: job_archive.JobArchiveNextParam
|
||||
(*JobDisplayArchive)(nil), // 11: job_archive.JobDisplayArchive
|
||||
}
|
||||
var file_job_proto_depIdxs = []int32{
|
||||
0, // 0: job.Job.status:type_name -> job.JobStatus
|
||||
3, // 1: job.Job.state:type_name -> job.JobState
|
||||
8, // 2: job.JobParam.Archive:type_name -> job_archive.JobParamArchive
|
||||
9, // 3: job.JobState.Archive:type_name -> job_archive.JobStateArchive
|
||||
10, // 4: job.JobNextParam.archive:type_name -> job_archive.JobArchiveNextParam
|
||||
2, // 5: job.CreatableJob.param:type_name -> job.JobParam
|
||||
0, // 6: job.JobFilter.status:type_name -> job.JobStatus
|
||||
11, // 7: job.JobDisplay.archive:type_name -> job_archive.JobDisplayArchive
|
||||
8, // [8:8] is the sub-list for method output_type
|
||||
8, // [8:8] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
8, // [8:8] is the sub-list for extension extendee
|
||||
0, // [0:8] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_job_proto_init() }
|
||||
func file_job_proto_init() {
|
||||
if File_job_proto != nil {
|
||||
return
|
||||
}
|
||||
file_job_archive_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_job_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Job); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobParam); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobState); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobNextParam); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CreatableJob); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobFilter); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobDisplay); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_job_proto_msgTypes[1].OneofWrappers = []interface{}{
|
||||
(*JobParam_Archive)(nil),
|
||||
}
|
||||
file_job_proto_msgTypes[2].OneofWrappers = []interface{}{
|
||||
(*JobState_Archive)(nil),
|
||||
}
|
||||
file_job_proto_msgTypes[3].OneofWrappers = []interface{}{
|
||||
(*JobNextParam_Archive)(nil),
|
||||
}
|
||||
file_job_proto_msgTypes[5].OneofWrappers = []interface{}{}
|
||||
file_job_proto_msgTypes[6].OneofWrappers = []interface{}{
|
||||
(*JobDisplay_Archive)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_job_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_job_proto_goTypes,
|
||||
DependencyIndexes: file_job_proto_depIdxs,
|
||||
EnumInfos: file_job_proto_enumTypes,
|
||||
MessageInfos: file_job_proto_msgTypes,
|
||||
}.Build()
|
||||
File_job_proto = out.File
|
||||
file_job_proto_rawDesc = nil
|
||||
file_job_proto_goTypes = nil
|
||||
file_job_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
syntax = "proto3";
|
||||
package job;
|
||||
option go_package = "github.com/abc950309/tapewriter/entity";
|
||||
|
||||
import "job_archive.proto";
|
||||
|
||||
enum JobStatus {
|
||||
Draft = 0;
|
||||
NotReady = 1; // dependencies not satisfied
|
||||
Pending = 2; // waiting in queue
|
||||
Processing = 3;
|
||||
Completed = 4;
|
||||
|
||||
Failed = 255;
|
||||
}
|
||||
|
||||
message Job {
|
||||
int64 id = 1;
|
||||
JobStatus status = 2;
|
||||
int64 priority = 3;
|
||||
int64 create_time = 4;
|
||||
int64 update_time = 5;
|
||||
|
||||
JobState state = 17;
|
||||
}
|
||||
|
||||
message JobParam {
|
||||
oneof param {
|
||||
job_archive.JobParamArchive Archive = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message JobState {
|
||||
oneof state {
|
||||
job_archive.JobStateArchive Archive = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message JobNextParam {
|
||||
oneof param {
|
||||
job_archive.JobArchiveNextParam archive = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message CreatableJob {
|
||||
int64 priority = 3;
|
||||
JobParam param = 17;
|
||||
}
|
||||
|
||||
message JobFilter {
|
||||
optional JobStatus status = 1;
|
||||
|
||||
optional int64 limit = 33;
|
||||
optional int64 offset = 34;
|
||||
}
|
||||
|
||||
message JobDisplay {
|
||||
oneof display {
|
||||
job_archive.JobDisplayArchive archive = 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,708 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.10
|
||||
// source: job_archive.proto
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type JobArchiveStep int32
|
||||
|
||||
const (
|
||||
JobArchiveStep_Pending JobArchiveStep = 0
|
||||
JobArchiveStep_WaitForTape JobArchiveStep = 1
|
||||
JobArchiveStep_Copying JobArchiveStep = 2
|
||||
JobArchiveStep_Finished JobArchiveStep = 255
|
||||
)
|
||||
|
||||
// Enum value maps for JobArchiveStep.
|
||||
var (
|
||||
JobArchiveStep_name = map[int32]string{
|
||||
0: "Pending",
|
||||
1: "WaitForTape",
|
||||
2: "Copying",
|
||||
255: "Finished",
|
||||
}
|
||||
JobArchiveStep_value = map[string]int32{
|
||||
"Pending": 0,
|
||||
"WaitForTape": 1,
|
||||
"Copying": 2,
|
||||
"Finished": 255,
|
||||
}
|
||||
)
|
||||
|
||||
func (x JobArchiveStep) Enum() *JobArchiveStep {
|
||||
p := new(JobArchiveStep)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x JobArchiveStep) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (JobArchiveStep) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_job_archive_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (JobArchiveStep) Type() protoreflect.EnumType {
|
||||
return &file_job_archive_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x JobArchiveStep) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobArchiveStep.Descriptor instead.
|
||||
func (JobArchiveStep) EnumDescriptor() ([]byte, []int) {
|
||||
return file_job_archive_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type JobParamArchive struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Sources []*Source `protobuf:"bytes,1,rep,name=sources,proto3" json:"sources,omitempty"`
|
||||
}
|
||||
|
||||
func (x *JobParamArchive) Reset() {
|
||||
*x = JobParamArchive{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_archive_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobParamArchive) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobParamArchive) ProtoMessage() {}
|
||||
|
||||
func (x *JobParamArchive) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_archive_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobParamArchive.ProtoReflect.Descriptor instead.
|
||||
func (*JobParamArchive) Descriptor() ([]byte, []int) {
|
||||
return file_job_archive_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *JobParamArchive) GetSources() []*Source {
|
||||
if x != nil {
|
||||
return x.Sources
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type JobArchiveNextParam struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to Param:
|
||||
// *JobArchiveNextParam_WaitForTape
|
||||
// *JobArchiveNextParam_Copying
|
||||
// *JobArchiveNextParam_Finished
|
||||
Param isJobArchiveNextParam_Param `protobuf_oneof:"param"`
|
||||
}
|
||||
|
||||
func (x *JobArchiveNextParam) Reset() {
|
||||
*x = JobArchiveNextParam{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_archive_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobArchiveNextParam) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobArchiveNextParam) ProtoMessage() {}
|
||||
|
||||
func (x *JobArchiveNextParam) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_archive_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobArchiveNextParam.ProtoReflect.Descriptor instead.
|
||||
func (*JobArchiveNextParam) Descriptor() ([]byte, []int) {
|
||||
return file_job_archive_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (m *JobArchiveNextParam) GetParam() isJobArchiveNextParam_Param {
|
||||
if m != nil {
|
||||
return m.Param
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JobArchiveNextParam) GetWaitForTape() *JobArchiveWaitForTapeParam {
|
||||
if x, ok := x.GetParam().(*JobArchiveNextParam_WaitForTape); ok {
|
||||
return x.WaitForTape
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JobArchiveNextParam) GetCopying() *JobArchiveCopyingParam {
|
||||
if x, ok := x.GetParam().(*JobArchiveNextParam_Copying); ok {
|
||||
return x.Copying
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JobArchiveNextParam) GetFinished() *JobArchiveFinishedParam {
|
||||
if x, ok := x.GetParam().(*JobArchiveNextParam_Finished); ok {
|
||||
return x.Finished
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isJobArchiveNextParam_Param interface {
|
||||
isJobArchiveNextParam_Param()
|
||||
}
|
||||
|
||||
type JobArchiveNextParam_WaitForTape struct {
|
||||
WaitForTape *JobArchiveWaitForTapeParam `protobuf:"bytes,1,opt,name=WaitForTape,proto3,oneof"`
|
||||
}
|
||||
|
||||
type JobArchiveNextParam_Copying struct {
|
||||
Copying *JobArchiveCopyingParam `protobuf:"bytes,2,opt,name=Copying,proto3,oneof"`
|
||||
}
|
||||
|
||||
type JobArchiveNextParam_Finished struct {
|
||||
Finished *JobArchiveFinishedParam `protobuf:"bytes,255,opt,name=Finished,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*JobArchiveNextParam_WaitForTape) isJobArchiveNextParam_Param() {}
|
||||
|
||||
func (*JobArchiveNextParam_Copying) isJobArchiveNextParam_Param() {}
|
||||
|
||||
func (*JobArchiveNextParam_Finished) isJobArchiveNextParam_Param() {}
|
||||
|
||||
type JobArchiveWaitForTapeParam struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *JobArchiveWaitForTapeParam) Reset() {
|
||||
*x = JobArchiveWaitForTapeParam{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_archive_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobArchiveWaitForTapeParam) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobArchiveWaitForTapeParam) ProtoMessage() {}
|
||||
|
||||
func (x *JobArchiveWaitForTapeParam) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_archive_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobArchiveWaitForTapeParam.ProtoReflect.Descriptor instead.
|
||||
func (*JobArchiveWaitForTapeParam) Descriptor() ([]byte, []int) {
|
||||
return file_job_archive_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
type JobArchiveCopyingParam struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
|
||||
Barcode string `protobuf:"bytes,2,opt,name=barcode,proto3" json:"barcode,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *JobArchiveCopyingParam) Reset() {
|
||||
*x = JobArchiveCopyingParam{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_archive_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobArchiveCopyingParam) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobArchiveCopyingParam) ProtoMessage() {}
|
||||
|
||||
func (x *JobArchiveCopyingParam) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_archive_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobArchiveCopyingParam.ProtoReflect.Descriptor instead.
|
||||
func (*JobArchiveCopyingParam) Descriptor() ([]byte, []int) {
|
||||
return file_job_archive_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *JobArchiveCopyingParam) GetDevice() string {
|
||||
if x != nil {
|
||||
return x.Device
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *JobArchiveCopyingParam) GetBarcode() string {
|
||||
if x != nil {
|
||||
return x.Barcode
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *JobArchiveCopyingParam) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type JobArchiveFinishedParam struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *JobArchiveFinishedParam) Reset() {
|
||||
*x = JobArchiveFinishedParam{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_archive_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobArchiveFinishedParam) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobArchiveFinishedParam) ProtoMessage() {}
|
||||
|
||||
func (x *JobArchiveFinishedParam) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_archive_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobArchiveFinishedParam.ProtoReflect.Descriptor instead.
|
||||
func (*JobArchiveFinishedParam) Descriptor() ([]byte, []int) {
|
||||
return file_job_archive_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
type JobStateArchive struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Step JobArchiveStep `protobuf:"varint,1,opt,name=step,proto3,enum=job_archive.JobArchiveStep" json:"step,omitempty"`
|
||||
Sources []*SourceState `protobuf:"bytes,2,rep,name=sources,proto3" json:"sources,omitempty"`
|
||||
}
|
||||
|
||||
func (x *JobStateArchive) Reset() {
|
||||
*x = JobStateArchive{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_archive_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobStateArchive) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobStateArchive) ProtoMessage() {}
|
||||
|
||||
func (x *JobStateArchive) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_archive_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobStateArchive.ProtoReflect.Descriptor instead.
|
||||
func (*JobStateArchive) Descriptor() ([]byte, []int) {
|
||||
return file_job_archive_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *JobStateArchive) GetStep() JobArchiveStep {
|
||||
if x != nil {
|
||||
return x.Step
|
||||
}
|
||||
return JobArchiveStep_Pending
|
||||
}
|
||||
|
||||
func (x *JobStateArchive) GetSources() []*SourceState {
|
||||
if x != nil {
|
||||
return x.Sources
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type JobDisplayArchive struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
CopyedBytes int64 `protobuf:"varint,1,opt,name=copyedBytes,proto3" json:"copyedBytes,omitempty"`
|
||||
CopyedFiles int64 `protobuf:"varint,2,opt,name=copyedFiles,proto3" json:"copyedFiles,omitempty"`
|
||||
TotalBytes int64 `protobuf:"varint,3,opt,name=totalBytes,proto3" json:"totalBytes,omitempty"`
|
||||
TotalFiles int64 `protobuf:"varint,4,opt,name=totalFiles,proto3" json:"totalFiles,omitempty"`
|
||||
Speed int64 `protobuf:"varint,5,opt,name=speed,proto3" json:"speed,omitempty"`
|
||||
}
|
||||
|
||||
func (x *JobDisplayArchive) Reset() {
|
||||
*x = JobDisplayArchive{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_archive_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobDisplayArchive) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobDisplayArchive) ProtoMessage() {}
|
||||
|
||||
func (x *JobDisplayArchive) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_archive_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobDisplayArchive.ProtoReflect.Descriptor instead.
|
||||
func (*JobDisplayArchive) Descriptor() ([]byte, []int) {
|
||||
return file_job_archive_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *JobDisplayArchive) GetCopyedBytes() int64 {
|
||||
if x != nil {
|
||||
return x.CopyedBytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *JobDisplayArchive) GetCopyedFiles() int64 {
|
||||
if x != nil {
|
||||
return x.CopyedFiles
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *JobDisplayArchive) GetTotalBytes() int64 {
|
||||
if x != nil {
|
||||
return x.TotalBytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *JobDisplayArchive) GetTotalFiles() int64 {
|
||||
if x != nil {
|
||||
return x.TotalFiles
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *JobDisplayArchive) GetSpeed() int64 {
|
||||
if x != nil {
|
||||
return x.Speed
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_job_archive_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_job_archive_proto_rawDesc = []byte{
|
||||
0x0a, 0x11, 0x6a, 0x6f, 0x62, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6a, 0x6f, 0x62, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65,
|
||||
0x1a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b,
|
||||
0x0a, 0x0f, 0x4a, 0x6f, 0x62, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76,
|
||||
0x65, 0x12, 0x28, 0x0a, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03,
|
||||
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x53, 0x6f, 0x75, 0x72,
|
||||
0x63, 0x65, 0x52, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0xf1, 0x01, 0x0a, 0x13,
|
||||
0x4a, 0x6f, 0x62, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x12, 0x4b, 0x0a, 0x0b, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x54, 0x61,
|
||||
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6a, 0x6f, 0x62, 0x5f, 0x61,
|
||||
0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76,
|
||||
0x65, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x54, 0x61, 0x70, 0x65, 0x50, 0x61, 0x72, 0x61,
|
||||
0x6d, 0x48, 0x00, 0x52, 0x0b, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x54, 0x61, 0x70, 0x65,
|
||||
0x12, 0x3f, 0x0a, 0x07, 0x43, 0x6f, 0x70, 0x79, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x23, 0x2e, 0x6a, 0x6f, 0x62, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e,
|
||||
0x4a, 0x6f, 0x62, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x69, 0x6e,
|
||||
0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x48, 0x00, 0x52, 0x07, 0x43, 0x6f, 0x70, 0x79, 0x69, 0x6e,
|
||||
0x67, 0x12, 0x43, 0x0a, 0x08, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0xff, 0x01,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6a, 0x6f, 0x62, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69,
|
||||
0x76, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x46, 0x69, 0x6e,
|
||||
0x69, 0x73, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x48, 0x00, 0x52, 0x08, 0x46, 0x69,
|
||||
0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x22,
|
||||
0x1c, 0x0a, 0x1a, 0x4a, 0x6f, 0x62, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x57, 0x61, 0x69,
|
||||
0x74, 0x46, 0x6f, 0x72, 0x54, 0x61, 0x70, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x5e, 0x0a,
|
||||
0x16, 0x4a, 0x6f, 0x62, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x43, 0x6f, 0x70, 0x79, 0x69,
|
||||
0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12,
|
||||
0x18, 0x0a, 0x07, 0x62, 0x61, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x07, 0x62, 0x61, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x19, 0x0a,
|
||||
0x17, 0x4a, 0x6f, 0x62, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73,
|
||||
0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x71, 0x0a, 0x0f, 0x4a, 0x6f, 0x62, 0x53,
|
||||
0x74, 0x61, 0x74, 0x65, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x73,
|
||||
0x74, 0x65, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6a, 0x6f, 0x62, 0x5f,
|
||||
0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x41, 0x72, 0x63, 0x68, 0x69,
|
||||
0x76, 0x65, 0x53, 0x74, 0x65, 0x70, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x2d, 0x0a, 0x07,
|
||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e,
|
||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x61,
|
||||
0x74, 0x65, 0x52, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0xad, 0x01, 0x0a, 0x11,
|
||||
0x4a, 0x6f, 0x62, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76,
|
||||
0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x70, 0x79, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x6f, 0x70, 0x79, 0x65, 0x64, 0x42, 0x79,
|
||||
0x74, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x70, 0x79, 0x65, 0x64, 0x46, 0x69, 0x6c,
|
||||
0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x6f, 0x70, 0x79, 0x65, 0x64,
|
||||
0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79,
|
||||
0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c,
|
||||
0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x46, 0x69,
|
||||
0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c,
|
||||
0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x05,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x2a, 0x4a, 0x0a, 0x0e, 0x4a,
|
||||
0x6f, 0x62, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x53, 0x74, 0x65, 0x70, 0x12, 0x0b, 0x0a,
|
||||
0x07, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x57, 0x61,
|
||||
0x69, 0x74, 0x46, 0x6f, 0x72, 0x54, 0x61, 0x70, 0x65, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43,
|
||||
0x6f, 0x70, 0x79, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x08, 0x46, 0x69, 0x6e, 0x69,
|
||||
0x73, 0x68, 0x65, 0x64, 0x10, 0xff, 0x01, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75,
|
||||
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x63, 0x39, 0x35, 0x30, 0x33, 0x30, 0x39, 0x2f,
|
||||
0x74, 0x61, 0x70, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74,
|
||||
0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_job_archive_proto_rawDescOnce sync.Once
|
||||
file_job_archive_proto_rawDescData = file_job_archive_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_job_archive_proto_rawDescGZIP() []byte {
|
||||
file_job_archive_proto_rawDescOnce.Do(func() {
|
||||
file_job_archive_proto_rawDescData = protoimpl.X.CompressGZIP(file_job_archive_proto_rawDescData)
|
||||
})
|
||||
return file_job_archive_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_job_archive_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_job_archive_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_job_archive_proto_goTypes = []interface{}{
|
||||
(JobArchiveStep)(0), // 0: job_archive.JobArchiveStep
|
||||
(*JobParamArchive)(nil), // 1: job_archive.JobParamArchive
|
||||
(*JobArchiveNextParam)(nil), // 2: job_archive.JobArchiveNextParam
|
||||
(*JobArchiveWaitForTapeParam)(nil), // 3: job_archive.JobArchiveWaitForTapeParam
|
||||
(*JobArchiveCopyingParam)(nil), // 4: job_archive.JobArchiveCopyingParam
|
||||
(*JobArchiveFinishedParam)(nil), // 5: job_archive.JobArchiveFinishedParam
|
||||
(*JobStateArchive)(nil), // 6: job_archive.JobStateArchive
|
||||
(*JobDisplayArchive)(nil), // 7: job_archive.JobDisplayArchive
|
||||
(*Source)(nil), // 8: source.Source
|
||||
(*SourceState)(nil), // 9: source.SourceState
|
||||
}
|
||||
var file_job_archive_proto_depIdxs = []int32{
|
||||
8, // 0: job_archive.JobParamArchive.sources:type_name -> source.Source
|
||||
3, // 1: job_archive.JobArchiveNextParam.WaitForTape:type_name -> job_archive.JobArchiveWaitForTapeParam
|
||||
4, // 2: job_archive.JobArchiveNextParam.Copying:type_name -> job_archive.JobArchiveCopyingParam
|
||||
5, // 3: job_archive.JobArchiveNextParam.Finished:type_name -> job_archive.JobArchiveFinishedParam
|
||||
0, // 4: job_archive.JobStateArchive.step:type_name -> job_archive.JobArchiveStep
|
||||
9, // 5: job_archive.JobStateArchive.sources:type_name -> source.SourceState
|
||||
6, // [6:6] is the sub-list for method output_type
|
||||
6, // [6:6] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_job_archive_proto_init() }
|
||||
func file_job_archive_proto_init() {
|
||||
if File_job_archive_proto != nil {
|
||||
return
|
||||
}
|
||||
file_source_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_job_archive_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobParamArchive); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_archive_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobArchiveNextParam); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_archive_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobArchiveWaitForTapeParam); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_archive_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobArchiveCopyingParam); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_archive_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobArchiveFinishedParam); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_archive_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobStateArchive); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_archive_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobDisplayArchive); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_job_archive_proto_msgTypes[1].OneofWrappers = []interface{}{
|
||||
(*JobArchiveNextParam_WaitForTape)(nil),
|
||||
(*JobArchiveNextParam_Copying)(nil),
|
||||
(*JobArchiveNextParam_Finished)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_job_archive_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_job_archive_proto_goTypes,
|
||||
DependencyIndexes: file_job_archive_proto_depIdxs,
|
||||
EnumInfos: file_job_archive_proto_enumTypes,
|
||||
MessageInfos: file_job_archive_proto_msgTypes,
|
||||
}.Build()
|
||||
File_job_archive_proto = out.File
|
||||
file_job_archive_proto_rawDesc = nil
|
||||
file_job_archive_proto_goTypes = nil
|
||||
file_job_archive_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
syntax = "proto3";
|
||||
package job_archive;
|
||||
option go_package = "github.com/abc950309/tapewriter/entity";
|
||||
|
||||
import "source.proto";
|
||||
|
||||
enum JobArchiveStep {
|
||||
Pending = 0;
|
||||
WaitForTape = 1;
|
||||
Copying = 2;
|
||||
|
||||
Finished = 255;
|
||||
}
|
||||
|
||||
message JobParamArchive {
|
||||
repeated source.Source sources = 1;
|
||||
}
|
||||
|
||||
message JobArchiveNextParam {
|
||||
oneof param {
|
||||
JobArchiveWaitForTapeParam WaitForTape = 1;
|
||||
JobArchiveCopyingParam Copying = 2;
|
||||
JobArchiveFinishedParam Finished = 255;
|
||||
}
|
||||
}
|
||||
|
||||
message JobArchiveWaitForTapeParam {}
|
||||
|
||||
message JobArchiveCopyingParam {
|
||||
string device = 1;
|
||||
string barcode = 2;
|
||||
string name = 3;
|
||||
}
|
||||
|
||||
message JobArchiveFinishedParam {}
|
||||
|
||||
message JobStateArchive {
|
||||
JobArchiveStep step = 1;
|
||||
repeated source.SourceState sources = 2;
|
||||
}
|
||||
|
||||
message JobDisplayArchive {
|
||||
int64 copyedBytes = 1;
|
||||
int64 copyedFiles = 2;
|
||||
int64 totalBytes = 3;
|
||||
int64 totalFiles = 4;
|
||||
|
||||
optional int64 speed = 5;
|
||||
}
|
||||
@@ -0,0 +1,791 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.10
|
||||
// source: job_restore.proto
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type JobRestoreStep int32
|
||||
|
||||
const (
|
||||
JobRestoreStep_Pending JobRestoreStep = 0
|
||||
JobRestoreStep_WaitForTape JobRestoreStep = 1
|
||||
JobRestoreStep_Copying JobRestoreStep = 2
|
||||
JobRestoreStep_Finished JobRestoreStep = 255
|
||||
)
|
||||
|
||||
// Enum value maps for JobRestoreStep.
|
||||
var (
|
||||
JobRestoreStep_name = map[int32]string{
|
||||
0: "Pending",
|
||||
1: "WaitForTape",
|
||||
2: "Copying",
|
||||
255: "Finished",
|
||||
}
|
||||
JobRestoreStep_value = map[string]int32{
|
||||
"Pending": 0,
|
||||
"WaitForTape": 1,
|
||||
"Copying": 2,
|
||||
"Finished": 255,
|
||||
}
|
||||
)
|
||||
|
||||
func (x JobRestoreStep) Enum() *JobRestoreStep {
|
||||
p := new(JobRestoreStep)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x JobRestoreStep) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (JobRestoreStep) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_job_restore_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (JobRestoreStep) Type() protoreflect.EnumType {
|
||||
return &file_job_restore_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x JobRestoreStep) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobRestoreStep.Descriptor instead.
|
||||
func (JobRestoreStep) EnumDescriptor() ([]byte, []int) {
|
||||
return file_job_restore_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type JobParamRestore struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
FileIds []int64 `protobuf:"varint,1,rep,packed,name=file_ids,json=fileIds,proto3" json:"file_ids,omitempty"`
|
||||
}
|
||||
|
||||
func (x *JobParamRestore) Reset() {
|
||||
*x = JobParamRestore{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_restore_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobParamRestore) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobParamRestore) ProtoMessage() {}
|
||||
|
||||
func (x *JobParamRestore) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_restore_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobParamRestore.ProtoReflect.Descriptor instead.
|
||||
func (*JobParamRestore) Descriptor() ([]byte, []int) {
|
||||
return file_job_restore_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *JobParamRestore) GetFileIds() []int64 {
|
||||
if x != nil {
|
||||
return x.FileIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type JobRestoreNextParam struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Types that are assignable to Param:
|
||||
// *JobRestoreNextParam_WaitForTape
|
||||
// *JobRestoreNextParam_Copying
|
||||
// *JobRestoreNextParam_Finished
|
||||
Param isJobRestoreNextParam_Param `protobuf_oneof:"param"`
|
||||
}
|
||||
|
||||
func (x *JobRestoreNextParam) Reset() {
|
||||
*x = JobRestoreNextParam{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_restore_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobRestoreNextParam) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobRestoreNextParam) ProtoMessage() {}
|
||||
|
||||
func (x *JobRestoreNextParam) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_restore_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobRestoreNextParam.ProtoReflect.Descriptor instead.
|
||||
func (*JobRestoreNextParam) Descriptor() ([]byte, []int) {
|
||||
return file_job_restore_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (m *JobRestoreNextParam) GetParam() isJobRestoreNextParam_Param {
|
||||
if m != nil {
|
||||
return m.Param
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JobRestoreNextParam) GetWaitForTape() *JobRestoreWaitForTapeParam {
|
||||
if x, ok := x.GetParam().(*JobRestoreNextParam_WaitForTape); ok {
|
||||
return x.WaitForTape
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JobRestoreNextParam) GetCopying() *JobRestoreCopyingParam {
|
||||
if x, ok := x.GetParam().(*JobRestoreNextParam_Copying); ok {
|
||||
return x.Copying
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *JobRestoreNextParam) GetFinished() *JobRestoreFinishedParam {
|
||||
if x, ok := x.GetParam().(*JobRestoreNextParam_Finished); ok {
|
||||
return x.Finished
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isJobRestoreNextParam_Param interface {
|
||||
isJobRestoreNextParam_Param()
|
||||
}
|
||||
|
||||
type JobRestoreNextParam_WaitForTape struct {
|
||||
WaitForTape *JobRestoreWaitForTapeParam `protobuf:"bytes,1,opt,name=WaitForTape,proto3,oneof"`
|
||||
}
|
||||
|
||||
type JobRestoreNextParam_Copying struct {
|
||||
Copying *JobRestoreCopyingParam `protobuf:"bytes,2,opt,name=Copying,proto3,oneof"`
|
||||
}
|
||||
|
||||
type JobRestoreNextParam_Finished struct {
|
||||
Finished *JobRestoreFinishedParam `protobuf:"bytes,255,opt,name=Finished,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*JobRestoreNextParam_WaitForTape) isJobRestoreNextParam_Param() {}
|
||||
|
||||
func (*JobRestoreNextParam_Copying) isJobRestoreNextParam_Param() {}
|
||||
|
||||
func (*JobRestoreNextParam_Finished) isJobRestoreNextParam_Param() {}
|
||||
|
||||
type JobRestoreWaitForTapeParam struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *JobRestoreWaitForTapeParam) Reset() {
|
||||
*x = JobRestoreWaitForTapeParam{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_restore_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobRestoreWaitForTapeParam) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobRestoreWaitForTapeParam) ProtoMessage() {}
|
||||
|
||||
func (x *JobRestoreWaitForTapeParam) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_restore_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobRestoreWaitForTapeParam.ProtoReflect.Descriptor instead.
|
||||
func (*JobRestoreWaitForTapeParam) Descriptor() ([]byte, []int) {
|
||||
return file_job_restore_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
type JobRestoreCopyingParam struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
|
||||
}
|
||||
|
||||
func (x *JobRestoreCopyingParam) Reset() {
|
||||
*x = JobRestoreCopyingParam{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_restore_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobRestoreCopyingParam) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobRestoreCopyingParam) ProtoMessage() {}
|
||||
|
||||
func (x *JobRestoreCopyingParam) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_restore_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobRestoreCopyingParam.ProtoReflect.Descriptor instead.
|
||||
func (*JobRestoreCopyingParam) Descriptor() ([]byte, []int) {
|
||||
return file_job_restore_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *JobRestoreCopyingParam) GetDevice() string {
|
||||
if x != nil {
|
||||
return x.Device
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type JobRestoreFinishedParam struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *JobRestoreFinishedParam) Reset() {
|
||||
*x = JobRestoreFinishedParam{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_restore_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobRestoreFinishedParam) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobRestoreFinishedParam) ProtoMessage() {}
|
||||
|
||||
func (x *JobRestoreFinishedParam) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_restore_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobRestoreFinishedParam.ProtoReflect.Descriptor instead.
|
||||
func (*JobRestoreFinishedParam) Descriptor() ([]byte, []int) {
|
||||
return file_job_restore_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
type FileRestoreState struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
FileId int64 `protobuf:"varint,1,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"`
|
||||
Status CopyStatus `protobuf:"varint,2,opt,name=status,proto3,enum=copy_status.CopyStatus" json:"status,omitempty"`
|
||||
TapeId int64 `protobuf:"varint,17,opt,name=tape_id,json=tapeId,proto3" json:"tape_id,omitempty"`
|
||||
PositionId int64 `protobuf:"varint,18,opt,name=position_id,json=positionId,proto3" json:"position_id,omitempty"`
|
||||
PathInTape []string `protobuf:"bytes,19,rep,name=path_in_tape,json=pathInTape,proto3" json:"path_in_tape,omitempty"`
|
||||
}
|
||||
|
||||
func (x *FileRestoreState) Reset() {
|
||||
*x = FileRestoreState{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_restore_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *FileRestoreState) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*FileRestoreState) ProtoMessage() {}
|
||||
|
||||
func (x *FileRestoreState) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_restore_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use FileRestoreState.ProtoReflect.Descriptor instead.
|
||||
func (*FileRestoreState) Descriptor() ([]byte, []int) {
|
||||
return file_job_restore_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *FileRestoreState) GetFileId() int64 {
|
||||
if x != nil {
|
||||
return x.FileId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *FileRestoreState) GetStatus() CopyStatus {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return CopyStatus_Draft
|
||||
}
|
||||
|
||||
func (x *FileRestoreState) GetTapeId() int64 {
|
||||
if x != nil {
|
||||
return x.TapeId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *FileRestoreState) GetPositionId() int64 {
|
||||
if x != nil {
|
||||
return x.PositionId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *FileRestoreState) GetPathInTape() []string {
|
||||
if x != nil {
|
||||
return x.PathInTape
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type JobStateRestore struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Step JobRestoreStep `protobuf:"varint,1,opt,name=step,proto3,enum=job_restore.JobRestoreStep" json:"step,omitempty"`
|
||||
Files []*FileRestoreState `protobuf:"bytes,2,rep,name=files,proto3" json:"files,omitempty"`
|
||||
}
|
||||
|
||||
func (x *JobStateRestore) Reset() {
|
||||
*x = JobStateRestore{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_restore_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobStateRestore) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobStateRestore) ProtoMessage() {}
|
||||
|
||||
func (x *JobStateRestore) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_restore_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobStateRestore.ProtoReflect.Descriptor instead.
|
||||
func (*JobStateRestore) Descriptor() ([]byte, []int) {
|
||||
return file_job_restore_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *JobStateRestore) GetStep() JobRestoreStep {
|
||||
if x != nil {
|
||||
return x.Step
|
||||
}
|
||||
return JobRestoreStep_Pending
|
||||
}
|
||||
|
||||
func (x *JobStateRestore) GetFiles() []*FileRestoreState {
|
||||
if x != nil {
|
||||
return x.Files
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type JobDisplayRestore struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
CopyedBytes int64 `protobuf:"varint,1,opt,name=copyedBytes,proto3" json:"copyedBytes,omitempty"`
|
||||
CopyedFiles int64 `protobuf:"varint,2,opt,name=copyedFiles,proto3" json:"copyedFiles,omitempty"`
|
||||
TotalBytes int64 `protobuf:"varint,3,opt,name=totalBytes,proto3" json:"totalBytes,omitempty"`
|
||||
TotalFiles int64 `protobuf:"varint,4,opt,name=totalFiles,proto3" json:"totalFiles,omitempty"`
|
||||
Logs []byte `protobuf:"bytes,17,opt,name=logs,proto3" json:"logs,omitempty"`
|
||||
}
|
||||
|
||||
func (x *JobDisplayRestore) Reset() {
|
||||
*x = JobDisplayRestore{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_job_restore_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *JobDisplayRestore) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*JobDisplayRestore) ProtoMessage() {}
|
||||
|
||||
func (x *JobDisplayRestore) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_job_restore_proto_msgTypes[7]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use JobDisplayRestore.ProtoReflect.Descriptor instead.
|
||||
func (*JobDisplayRestore) Descriptor() ([]byte, []int) {
|
||||
return file_job_restore_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *JobDisplayRestore) GetCopyedBytes() int64 {
|
||||
if x != nil {
|
||||
return x.CopyedBytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *JobDisplayRestore) GetCopyedFiles() int64 {
|
||||
if x != nil {
|
||||
return x.CopyedFiles
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *JobDisplayRestore) GetTotalBytes() int64 {
|
||||
if x != nil {
|
||||
return x.TotalBytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *JobDisplayRestore) GetTotalFiles() int64 {
|
||||
if x != nil {
|
||||
return x.TotalFiles
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *JobDisplayRestore) GetLogs() []byte {
|
||||
if x != nil {
|
||||
return x.Logs
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_job_restore_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_job_restore_proto_rawDesc = []byte{
|
||||
0x0a, 0x11, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
|
||||
0x1a, 0x11, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x0f, 0x4a, 0x6f, 0x62, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x52,
|
||||
0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69,
|
||||
0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64,
|
||||
0x73, 0x22, 0xf1, 0x01, 0x0a, 0x13, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
|
||||
0x4e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x4b, 0x0a, 0x0b, 0x57, 0x61, 0x69,
|
||||
0x74, 0x46, 0x6f, 0x72, 0x54, 0x61, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27,
|
||||
0x2e, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4a, 0x6f, 0x62,
|
||||
0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x54, 0x61,
|
||||
0x70, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x48, 0x00, 0x52, 0x0b, 0x57, 0x61, 0x69, 0x74, 0x46,
|
||||
0x6f, 0x72, 0x54, 0x61, 0x70, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x43, 0x6f, 0x70, 0x79, 0x69, 0x6e,
|
||||
0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x65,
|
||||
0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
|
||||
0x43, 0x6f, 0x70, 0x79, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x48, 0x00, 0x52, 0x07,
|
||||
0x43, 0x6f, 0x70, 0x79, 0x69, 0x6e, 0x67, 0x12, 0x43, 0x0a, 0x08, 0x46, 0x69, 0x6e, 0x69, 0x73,
|
||||
0x68, 0x65, 0x64, 0x18, 0xff, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6a, 0x6f, 0x62,
|
||||
0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x74,
|
||||
0x6f, 0x72, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||
0x48, 0x00, 0x52, 0x08, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x42, 0x07, 0x0a, 0x05,
|
||||
0x70, 0x61, 0x72, 0x61, 0x6d, 0x22, 0x1c, 0x0a, 0x1a, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x74,
|
||||
0x6f, 0x72, 0x65, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x54, 0x61, 0x70, 0x65, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x22, 0x30, 0x0a, 0x16, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72,
|
||||
0x65, 0x43, 0x6f, 0x70, 0x79, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64,
|
||||
0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x19, 0x0a, 0x17, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x74,
|
||||
0x6f, 0x72, 0x65, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
||||
0x22, 0xb8, 0x01, 0x0a, 0x10, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
|
||||
0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x69, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x2f,
|
||||
0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17,
|
||||
0x2e, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x70,
|
||||
0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
|
||||
0x17, 0x0a, 0x07, 0x74, 0x61, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x06, 0x74, 0x61, 0x70, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x73, 0x69,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70,
|
||||
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x70, 0x61, 0x74,
|
||||
0x68, 0x5f, 0x69, 0x6e, 0x5f, 0x74, 0x61, 0x70, 0x65, 0x18, 0x13, 0x20, 0x03, 0x28, 0x09, 0x52,
|
||||
0x0a, 0x70, 0x61, 0x74, 0x68, 0x49, 0x6e, 0x54, 0x61, 0x70, 0x65, 0x22, 0x77, 0x0a, 0x0f, 0x4a,
|
||||
0x6f, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x2f,
|
||||
0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x6a,
|
||||
0x6f, 0x62, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4a, 0x6f, 0x62, 0x52, 0x65,
|
||||
0x73, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x65, 0x70, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12,
|
||||
0x33, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d,
|
||||
0x2e, 0x6a, 0x6f, 0x62, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x46, 0x69, 0x6c,
|
||||
0x65, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x66,
|
||||
0x69, 0x6c, 0x65, 0x73, 0x22, 0xab, 0x01, 0x0a, 0x11, 0x4a, 0x6f, 0x62, 0x44, 0x69, 0x73, 0x70,
|
||||
0x6c, 0x61, 0x79, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f,
|
||||
0x70, 0x79, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x0b, 0x63, 0x6f, 0x70, 0x79, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b,
|
||||
0x63, 0x6f, 0x70, 0x79, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x0b, 0x63, 0x6f, 0x70, 0x79, 0x65, 0x64, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x1e,
|
||||
0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1e,
|
||||
0x0a, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6c, 0x6f,
|
||||
0x67, 0x73, 0x2a, 0x4a, 0x0a, 0x0e, 0x4a, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65,
|
||||
0x53, 0x74, 0x65, 0x70, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x10,
|
||||
0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x57, 0x61, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x54, 0x61, 0x70, 0x65,
|
||||
0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x70, 0x79, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12,
|
||||
0x0d, 0x0a, 0x08, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xff, 0x01, 0x42, 0x28,
|
||||
0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x63,
|
||||
0x39, 0x35, 0x30, 0x33, 0x30, 0x39, 0x2f, 0x74, 0x61, 0x70, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65,
|
||||
0x72, 0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_job_restore_proto_rawDescOnce sync.Once
|
||||
file_job_restore_proto_rawDescData = file_job_restore_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_job_restore_proto_rawDescGZIP() []byte {
|
||||
file_job_restore_proto_rawDescOnce.Do(func() {
|
||||
file_job_restore_proto_rawDescData = protoimpl.X.CompressGZIP(file_job_restore_proto_rawDescData)
|
||||
})
|
||||
return file_job_restore_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_job_restore_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_job_restore_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||
var file_job_restore_proto_goTypes = []interface{}{
|
||||
(JobRestoreStep)(0), // 0: job_restore.JobRestoreStep
|
||||
(*JobParamRestore)(nil), // 1: job_restore.JobParamRestore
|
||||
(*JobRestoreNextParam)(nil), // 2: job_restore.JobRestoreNextParam
|
||||
(*JobRestoreWaitForTapeParam)(nil), // 3: job_restore.JobRestoreWaitForTapeParam
|
||||
(*JobRestoreCopyingParam)(nil), // 4: job_restore.JobRestoreCopyingParam
|
||||
(*JobRestoreFinishedParam)(nil), // 5: job_restore.JobRestoreFinishedParam
|
||||
(*FileRestoreState)(nil), // 6: job_restore.FileRestoreState
|
||||
(*JobStateRestore)(nil), // 7: job_restore.JobStateRestore
|
||||
(*JobDisplayRestore)(nil), // 8: job_restore.JobDisplayRestore
|
||||
(CopyStatus)(0), // 9: copy_status.CopyStatus
|
||||
}
|
||||
var file_job_restore_proto_depIdxs = []int32{
|
||||
3, // 0: job_restore.JobRestoreNextParam.WaitForTape:type_name -> job_restore.JobRestoreWaitForTapeParam
|
||||
4, // 1: job_restore.JobRestoreNextParam.Copying:type_name -> job_restore.JobRestoreCopyingParam
|
||||
5, // 2: job_restore.JobRestoreNextParam.Finished:type_name -> job_restore.JobRestoreFinishedParam
|
||||
9, // 3: job_restore.FileRestoreState.status:type_name -> copy_status.CopyStatus
|
||||
0, // 4: job_restore.JobStateRestore.step:type_name -> job_restore.JobRestoreStep
|
||||
6, // 5: job_restore.JobStateRestore.files:type_name -> job_restore.FileRestoreState
|
||||
6, // [6:6] is the sub-list for method output_type
|
||||
6, // [6:6] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_job_restore_proto_init() }
|
||||
func file_job_restore_proto_init() {
|
||||
if File_job_restore_proto != nil {
|
||||
return
|
||||
}
|
||||
file_copy_status_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_job_restore_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobParamRestore); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_restore_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobRestoreNextParam); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_restore_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobRestoreWaitForTapeParam); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_restore_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobRestoreCopyingParam); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_restore_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobRestoreFinishedParam); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_restore_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*FileRestoreState); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_restore_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobStateRestore); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_job_restore_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*JobDisplayRestore); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_job_restore_proto_msgTypes[1].OneofWrappers = []interface{}{
|
||||
(*JobRestoreNextParam_WaitForTape)(nil),
|
||||
(*JobRestoreNextParam_Copying)(nil),
|
||||
(*JobRestoreNextParam_Finished)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_job_restore_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 8,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_job_restore_proto_goTypes,
|
||||
DependencyIndexes: file_job_restore_proto_depIdxs,
|
||||
EnumInfos: file_job_restore_proto_enumTypes,
|
||||
MessageInfos: file_job_restore_proto_msgTypes,
|
||||
}.Build()
|
||||
File_job_restore_proto = out.File
|
||||
file_job_restore_proto_rawDesc = nil
|
||||
file_job_restore_proto_goTypes = nil
|
||||
file_job_restore_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
syntax = "proto3";
|
||||
package job_restore;
|
||||
option go_package = "github.com/abc950309/tapewriter/entity";
|
||||
|
||||
import "copy_status.proto";
|
||||
|
||||
enum JobRestoreStep {
|
||||
Pending = 0;
|
||||
WaitForTape = 1;
|
||||
Copying = 2;
|
||||
|
||||
Finished = 255;
|
||||
}
|
||||
|
||||
message JobParamRestore {
|
||||
repeated int64 file_ids = 1;
|
||||
}
|
||||
|
||||
message JobRestoreNextParam {
|
||||
oneof param {
|
||||
JobRestoreWaitForTapeParam WaitForTape = 1;
|
||||
JobRestoreCopyingParam Copying = 2;
|
||||
JobRestoreFinishedParam Finished = 255;
|
||||
}
|
||||
}
|
||||
|
||||
message JobRestoreWaitForTapeParam {}
|
||||
|
||||
message JobRestoreCopyingParam {
|
||||
string device = 1;
|
||||
}
|
||||
|
||||
message JobRestoreFinishedParam {}
|
||||
|
||||
message FileRestoreState {
|
||||
int64 file_id = 1;
|
||||
copy_status.CopyStatus status = 2;
|
||||
|
||||
int64 tape_id = 17;
|
||||
int64 position_id = 18;
|
||||
repeated string path_in_tape = 19;
|
||||
}
|
||||
|
||||
message JobStateRestore {
|
||||
JobRestoreStep step = 1;
|
||||
repeated FileRestoreState files = 2;
|
||||
}
|
||||
|
||||
message JobDisplayRestore {
|
||||
int64 copyedBytes = 1;
|
||||
int64 copyedFiles = 2;
|
||||
int64 totalBytes = 3;
|
||||
int64 totalFiles = 4;
|
||||
|
||||
bytes logs = 17;
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.10
|
||||
// source: position.proto
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Position struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
FileId int64 `protobuf:"varint,2,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"`
|
||||
TapeId int64 `protobuf:"varint,3,opt,name=tape_id,json=tapeId,proto3" json:"tape_id,omitempty"`
|
||||
Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
|
||||
Mode int64 `protobuf:"varint,17,opt,name=mode,proto3" json:"mode,omitempty"`
|
||||
ModTime int64 `protobuf:"varint,18,opt,name=mod_time,json=modTime,proto3" json:"mod_time,omitempty"`
|
||||
WriteTime int64 `protobuf:"varint,19,opt,name=write_time,json=writeTime,proto3" json:"write_time,omitempty"`
|
||||
Size int64 `protobuf:"varint,20,opt,name=size,proto3" json:"size,omitempty"`
|
||||
Hash []byte `protobuf:"bytes,21,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Position) Reset() {
|
||||
*x = Position{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_position_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Position) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Position) ProtoMessage() {}
|
||||
|
||||
func (x *Position) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_position_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Position.ProtoReflect.Descriptor instead.
|
||||
func (*Position) Descriptor() ([]byte, []int) {
|
||||
return file_position_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Position) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Position) GetFileId() int64 {
|
||||
if x != nil {
|
||||
return x.FileId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Position) GetTapeId() int64 {
|
||||
if x != nil {
|
||||
return x.TapeId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Position) GetPath() string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Position) GetMode() int64 {
|
||||
if x != nil {
|
||||
return x.Mode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Position) GetModTime() int64 {
|
||||
if x != nil {
|
||||
return x.ModTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Position) GetWriteTime() int64 {
|
||||
if x != nil {
|
||||
return x.WriteTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Position) GetSize() int64 {
|
||||
if x != nil {
|
||||
return x.Size
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Position) GetHash() []byte {
|
||||
if x != nil {
|
||||
return x.Hash
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_position_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_position_proto_rawDesc = []byte{
|
||||
0x0a, 0x0e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x12, 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xd6, 0x01, 0x0a, 0x08, 0x50,
|
||||
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x5f,
|
||||
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x65, 0x49, 0x64,
|
||||
0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x70, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x06, 0x74, 0x61, 0x70, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74,
|
||||
0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x6d, 0x6f, 0x64,
|
||||
0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x6f, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x12, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a,
|
||||
0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x09, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73,
|
||||
0x69, 0x7a, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68,
|
||||
0x61, 0x73, 0x68, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x61, 0x62, 0x63, 0x39, 0x35, 0x30, 0x33, 0x30, 0x39, 0x2f, 0x74, 0x61, 0x70, 0x65,
|
||||
0x77, 0x72, 0x69, 0x74, 0x65, 0x72, 0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_position_proto_rawDescOnce sync.Once
|
||||
file_position_proto_rawDescData = file_position_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_position_proto_rawDescGZIP() []byte {
|
||||
file_position_proto_rawDescOnce.Do(func() {
|
||||
file_position_proto_rawDescData = protoimpl.X.CompressGZIP(file_position_proto_rawDescData)
|
||||
})
|
||||
return file_position_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_position_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_position_proto_goTypes = []interface{}{
|
||||
(*Position)(nil), // 0: position.Position
|
||||
}
|
||||
var file_position_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_position_proto_init() }
|
||||
func file_position_proto_init() {
|
||||
if File_position_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_position_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Position); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_position_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_position_proto_goTypes,
|
||||
DependencyIndexes: file_position_proto_depIdxs,
|
||||
MessageInfos: file_position_proto_msgTypes,
|
||||
}.Build()
|
||||
File_position_proto = out.File
|
||||
file_position_proto_rawDesc = nil
|
||||
file_position_proto_goTypes = nil
|
||||
file_position_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
syntax = "proto3";
|
||||
package position;
|
||||
option go_package = "github.com/abc950309/tapewriter/entity";
|
||||
|
||||
message Position {
|
||||
int64 id = 1;
|
||||
int64 file_id = 2;
|
||||
int64 tape_id = 3;
|
||||
string path = 4;
|
||||
|
||||
int64 mode = 17;
|
||||
int64 mod_time = 18;
|
||||
int64 write_time = 19;
|
||||
int64 size = 20;
|
||||
bytes hash = 21;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,145 @@
|
||||
syntax = "proto3";
|
||||
package service;
|
||||
option go_package = "github.com/abc950309/tapewriter/entity";
|
||||
|
||||
import "job.proto";
|
||||
import "file.proto";
|
||||
import "position.proto";
|
||||
import "tape.proto";
|
||||
import "source.proto";
|
||||
|
||||
service Service {
|
||||
rpc FileGet(FileGetRequest) returns (FileGetReply) {}
|
||||
rpc FileEdit(FileEditRequest) returns (FileEditReply) {}
|
||||
rpc FileMkdir(FileMkdirRequest) returns (FileMkdirReply) {}
|
||||
rpc FileDelete(FileDeleteRequest) returns (FileDeleteReply) {}
|
||||
rpc FileListParents(FileListParentsRequest) returns (FileListParentsReply) {}
|
||||
|
||||
rpc TapeMGet(TapeMGetRequest) returns (TapeMGetReply) {}
|
||||
|
||||
rpc JobList(JobListRequest) returns (JobListReply) {}
|
||||
rpc JobCreate(JobCreateRequest) returns (JobCreateReply) {}
|
||||
rpc JobNext(JobNextRequest) returns (JobNextReply) {}
|
||||
rpc JobDisplay(JobDisplayRequest) returns (JobDisplayReply) {}
|
||||
rpc JobGetLog(JobGetLogRequest) returns (JobGetLogReply) {}
|
||||
|
||||
rpc SourceList(SourceListRequest) returns (SourceListReply) {}
|
||||
|
||||
rpc DeviceList(DeviceListRequest) returns (DeviceListReply) {}
|
||||
}
|
||||
|
||||
message FileGetRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message FileGetReply {
|
||||
optional file.File file = 1;
|
||||
repeated position.Position positions = 2;
|
||||
repeated file.File children = 17;
|
||||
}
|
||||
|
||||
message FileEditRequest {
|
||||
int64 id = 1;
|
||||
file.EditedFile file = 2;
|
||||
}
|
||||
|
||||
message FileEditReply {
|
||||
file.File file = 1;
|
||||
}
|
||||
|
||||
message FileMkdirRequest {
|
||||
int64 parent_id = 1;
|
||||
string path = 2;
|
||||
}
|
||||
|
||||
message FileMkdirReply {
|
||||
file.File file = 1;
|
||||
}
|
||||
|
||||
message FileDeleteRequest {
|
||||
repeated int64 ids = 1;
|
||||
}
|
||||
|
||||
message FileDeleteReply {
|
||||
}
|
||||
|
||||
message FileListParentsRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message FileListParentsReply {
|
||||
repeated file.File parents = 1;
|
||||
}
|
||||
|
||||
message TapeMGetRequest {
|
||||
repeated int64 ids = 1;
|
||||
}
|
||||
|
||||
message TapeMGetReply {
|
||||
repeated tape.Tape tapes = 1;
|
||||
}
|
||||
|
||||
message JobListRequest {
|
||||
oneof param {
|
||||
JobMGetRequest mget = 1;
|
||||
job.JobFilter list = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message JobMGetRequest {
|
||||
repeated int64 ids = 1;
|
||||
}
|
||||
|
||||
message JobListReply {
|
||||
repeated job.Job jobs = 1;
|
||||
}
|
||||
|
||||
message JobCreateRequest {
|
||||
job.CreatableJob job = 1;
|
||||
}
|
||||
|
||||
message JobCreateReply {
|
||||
job.Job job = 1;
|
||||
}
|
||||
|
||||
message JobNextRequest {
|
||||
int64 id = 1;
|
||||
job.JobNextParam param = 2;
|
||||
}
|
||||
|
||||
message JobNextReply {
|
||||
job.Job job = 1;
|
||||
}
|
||||
|
||||
message JobDisplayRequest {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message JobDisplayReply {
|
||||
job.JobDisplay display = 1;
|
||||
}
|
||||
|
||||
message JobGetLogRequest {
|
||||
int64 job_id = 1;
|
||||
optional int64 offset = 2;
|
||||
}
|
||||
|
||||
message JobGetLogReply {
|
||||
bytes logs = 1;
|
||||
}
|
||||
|
||||
message SourceListRequest {
|
||||
string path = 1;
|
||||
}
|
||||
|
||||
message SourceListReply {
|
||||
source.SourceFile file = 1;
|
||||
repeated source.SourceFile chain = 2;
|
||||
repeated source.SourceFile children = 17;
|
||||
}
|
||||
|
||||
message DeviceListRequest {}
|
||||
|
||||
message DeviceListReply {
|
||||
repeated string devices = 1;
|
||||
}
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
CURDIR=$(cd $(dirname $0); pwd);
|
||||
cd ${CURDIR};
|
||||
|
||||
SRC_DIR=${CURDIR};
|
||||
GO_DST_DIR=${CURDIR};
|
||||
TS_DST_DIR=${CURDIR}/../frontend/src/apis;
|
||||
|
||||
protoc --go_out=$GO_DST_DIR --go_opt=paths=source_relative \
|
||||
--go-grpc_out=$GO_DST_DIR --go-grpc_opt=paths=source_relative \
|
||||
-I=$SRC_DIR `ls *.proto`;
|
||||
|
||||
# --js_out=import_style=es6,binary:$TS_DST_DIR \
|
||||
# --grpc-web_out=import_style=typescript,mode=grpcwebtext:$TS_DST_DIR \
|
||||
@@ -0,0 +1,537 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.21.10
|
||||
// source: service.proto
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// ServiceClient is the client API for Service service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type ServiceClient interface {
|
||||
FileGet(ctx context.Context, in *FileGetRequest, opts ...grpc.CallOption) (*FileGetReply, error)
|
||||
FileEdit(ctx context.Context, in *FileEditRequest, opts ...grpc.CallOption) (*FileEditReply, error)
|
||||
FileMkdir(ctx context.Context, in *FileMkdirRequest, opts ...grpc.CallOption) (*FileMkdirReply, error)
|
||||
FileDelete(ctx context.Context, in *FileDeleteRequest, opts ...grpc.CallOption) (*FileDeleteReply, error)
|
||||
FileListParents(ctx context.Context, in *FileListParentsRequest, opts ...grpc.CallOption) (*FileListParentsReply, error)
|
||||
TapeMGet(ctx context.Context, in *TapeMGetRequest, opts ...grpc.CallOption) (*TapeMGetReply, error)
|
||||
JobList(ctx context.Context, in *JobListRequest, opts ...grpc.CallOption) (*JobListReply, error)
|
||||
JobCreate(ctx context.Context, in *JobCreateRequest, opts ...grpc.CallOption) (*JobCreateReply, error)
|
||||
JobNext(ctx context.Context, in *JobNextRequest, opts ...grpc.CallOption) (*JobNextReply, error)
|
||||
JobDisplay(ctx context.Context, in *JobDisplayRequest, opts ...grpc.CallOption) (*JobDisplayReply, error)
|
||||
JobGetLog(ctx context.Context, in *JobGetLogRequest, opts ...grpc.CallOption) (*JobGetLogReply, error)
|
||||
SourceList(ctx context.Context, in *SourceListRequest, opts ...grpc.CallOption) (*SourceListReply, error)
|
||||
DeviceList(ctx context.Context, in *DeviceListRequest, opts ...grpc.CallOption) (*DeviceListReply, error)
|
||||
}
|
||||
|
||||
type serviceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient {
|
||||
return &serviceClient{cc}
|
||||
}
|
||||
|
||||
func (c *serviceClient) FileGet(ctx context.Context, in *FileGetRequest, opts ...grpc.CallOption) (*FileGetReply, error) {
|
||||
out := new(FileGetReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/FileGet", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) FileEdit(ctx context.Context, in *FileEditRequest, opts ...grpc.CallOption) (*FileEditReply, error) {
|
||||
out := new(FileEditReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/FileEdit", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) FileMkdir(ctx context.Context, in *FileMkdirRequest, opts ...grpc.CallOption) (*FileMkdirReply, error) {
|
||||
out := new(FileMkdirReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/FileMkdir", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) FileDelete(ctx context.Context, in *FileDeleteRequest, opts ...grpc.CallOption) (*FileDeleteReply, error) {
|
||||
out := new(FileDeleteReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/FileDelete", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) FileListParents(ctx context.Context, in *FileListParentsRequest, opts ...grpc.CallOption) (*FileListParentsReply, error) {
|
||||
out := new(FileListParentsReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/FileListParents", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) TapeMGet(ctx context.Context, in *TapeMGetRequest, opts ...grpc.CallOption) (*TapeMGetReply, error) {
|
||||
out := new(TapeMGetReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/TapeMGet", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) JobList(ctx context.Context, in *JobListRequest, opts ...grpc.CallOption) (*JobListReply, error) {
|
||||
out := new(JobListReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/JobList", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) JobCreate(ctx context.Context, in *JobCreateRequest, opts ...grpc.CallOption) (*JobCreateReply, error) {
|
||||
out := new(JobCreateReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/JobCreate", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) JobNext(ctx context.Context, in *JobNextRequest, opts ...grpc.CallOption) (*JobNextReply, error) {
|
||||
out := new(JobNextReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/JobNext", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) JobDisplay(ctx context.Context, in *JobDisplayRequest, opts ...grpc.CallOption) (*JobDisplayReply, error) {
|
||||
out := new(JobDisplayReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/JobDisplay", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) JobGetLog(ctx context.Context, in *JobGetLogRequest, opts ...grpc.CallOption) (*JobGetLogReply, error) {
|
||||
out := new(JobGetLogReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/JobGetLog", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) SourceList(ctx context.Context, in *SourceListRequest, opts ...grpc.CallOption) (*SourceListReply, error) {
|
||||
out := new(SourceListReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/SourceList", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *serviceClient) DeviceList(ctx context.Context, in *DeviceListRequest, opts ...grpc.CallOption) (*DeviceListReply, error) {
|
||||
out := new(DeviceListReply)
|
||||
err := c.cc.Invoke(ctx, "/service.Service/DeviceList", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ServiceServer is the server API for Service service.
|
||||
// All implementations must embed UnimplementedServiceServer
|
||||
// for forward compatibility
|
||||
type ServiceServer interface {
|
||||
FileGet(context.Context, *FileGetRequest) (*FileGetReply, error)
|
||||
FileEdit(context.Context, *FileEditRequest) (*FileEditReply, error)
|
||||
FileMkdir(context.Context, *FileMkdirRequest) (*FileMkdirReply, error)
|
||||
FileDelete(context.Context, *FileDeleteRequest) (*FileDeleteReply, error)
|
||||
FileListParents(context.Context, *FileListParentsRequest) (*FileListParentsReply, error)
|
||||
TapeMGet(context.Context, *TapeMGetRequest) (*TapeMGetReply, error)
|
||||
JobList(context.Context, *JobListRequest) (*JobListReply, error)
|
||||
JobCreate(context.Context, *JobCreateRequest) (*JobCreateReply, error)
|
||||
JobNext(context.Context, *JobNextRequest) (*JobNextReply, error)
|
||||
JobDisplay(context.Context, *JobDisplayRequest) (*JobDisplayReply, error)
|
||||
JobGetLog(context.Context, *JobGetLogRequest) (*JobGetLogReply, error)
|
||||
SourceList(context.Context, *SourceListRequest) (*SourceListReply, error)
|
||||
DeviceList(context.Context, *DeviceListRequest) (*DeviceListReply, error)
|
||||
mustEmbedUnimplementedServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedServiceServer) FileGet(context.Context, *FileGetRequest) (*FileGetReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FileGet not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) FileEdit(context.Context, *FileEditRequest) (*FileEditReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FileEdit not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) FileMkdir(context.Context, *FileMkdirRequest) (*FileMkdirReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FileMkdir not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) FileDelete(context.Context, *FileDeleteRequest) (*FileDeleteReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FileDelete not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) FileListParents(context.Context, *FileListParentsRequest) (*FileListParentsReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FileListParents not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) TapeMGet(context.Context, *TapeMGetRequest) (*TapeMGetReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method TapeMGet not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) JobList(context.Context, *JobListRequest) (*JobListReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method JobList not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) JobCreate(context.Context, *JobCreateRequest) (*JobCreateReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method JobCreate not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) JobNext(context.Context, *JobNextRequest) (*JobNextReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method JobNext not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) JobDisplay(context.Context, *JobDisplayRequest) (*JobDisplayReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method JobDisplay not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) JobGetLog(context.Context, *JobGetLogRequest) (*JobGetLogReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method JobGetLog not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) SourceList(context.Context, *SourceListRequest) (*SourceListReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SourceList not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) DeviceList(context.Context, *DeviceListRequest) (*DeviceListReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeviceList not implemented")
|
||||
}
|
||||
func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {}
|
||||
|
||||
// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeServiceServer interface {
|
||||
mustEmbedUnimplementedServiceServer()
|
||||
}
|
||||
|
||||
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) {
|
||||
s.RegisterService(&Service_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Service_FileGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FileGetRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).FileGet(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/FileGet",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).FileGet(ctx, req.(*FileGetRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_FileEdit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FileEditRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).FileEdit(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/FileEdit",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).FileEdit(ctx, req.(*FileEditRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_FileMkdir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FileMkdirRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).FileMkdir(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/FileMkdir",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).FileMkdir(ctx, req.(*FileMkdirRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_FileDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FileDeleteRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).FileDelete(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/FileDelete",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).FileDelete(ctx, req.(*FileDeleteRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_FileListParents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FileListParentsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).FileListParents(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/FileListParents",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).FileListParents(ctx, req.(*FileListParentsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_TapeMGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TapeMGetRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).TapeMGet(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/TapeMGet",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).TapeMGet(ctx, req.(*TapeMGetRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_JobList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(JobListRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).JobList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/JobList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).JobList(ctx, req.(*JobListRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_JobCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(JobCreateRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).JobCreate(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/JobCreate",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).JobCreate(ctx, req.(*JobCreateRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_JobNext_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(JobNextRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).JobNext(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/JobNext",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).JobNext(ctx, req.(*JobNextRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_JobDisplay_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(JobDisplayRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).JobDisplay(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/JobDisplay",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).JobDisplay(ctx, req.(*JobDisplayRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_JobGetLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(JobGetLogRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).JobGetLog(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/JobGetLog",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).JobGetLog(ctx, req.(*JobGetLogRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_SourceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SourceListRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).SourceList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/SourceList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).SourceList(ctx, req.(*SourceListRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Service_DeviceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeviceListRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ServiceServer).DeviceList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/service.Service/DeviceList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ServiceServer).DeviceList(ctx, req.(*DeviceListRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Service_ServiceDesc is the grpc.ServiceDesc for Service service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Service_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "service.Service",
|
||||
HandlerType: (*ServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "FileGet",
|
||||
Handler: _Service_FileGet_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FileEdit",
|
||||
Handler: _Service_FileEdit_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FileMkdir",
|
||||
Handler: _Service_FileMkdir_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FileDelete",
|
||||
Handler: _Service_FileDelete_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FileListParents",
|
||||
Handler: _Service_FileListParents_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "TapeMGet",
|
||||
Handler: _Service_TapeMGet_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "JobList",
|
||||
Handler: _Service_JobList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "JobCreate",
|
||||
Handler: _Service_JobCreate_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "JobNext",
|
||||
Handler: _Service_JobNext_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "JobDisplay",
|
||||
Handler: _Service_JobDisplay_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "JobGetLog",
|
||||
Handler: _Service_JobGetLog_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SourceList",
|
||||
Handler: _Service_SourceList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeviceList",
|
||||
Handler: _Service_DeviceList_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "service.proto",
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"path"
|
||||
|
||||
"github.com/abc950309/acp"
|
||||
)
|
||||
|
||||
func NewSourceFromACPJob(job *acp.Job) *Source {
|
||||
return &Source{Base: job.Base, Path: job.Path}
|
||||
}
|
||||
|
||||
func (x *Source) RealPath() string {
|
||||
return x.Base + path.Join(x.Path...)
|
||||
}
|
||||
|
||||
func (x *Source) Append(more ...string) *Source {
|
||||
path := make([]string, len(x.Path)+len(more))
|
||||
copy(path, x.Path)
|
||||
copy(path[len(x.Path):], more)
|
||||
|
||||
return &Source{Base: x.Base, Path: path}
|
||||
}
|
||||
|
||||
func (x *Source) Compare(xx *Source) int {
|
||||
la, lb := len(x.Path), len(x.Path)
|
||||
|
||||
l := la
|
||||
if lb < la {
|
||||
l = lb
|
||||
}
|
||||
|
||||
for idx := 0; idx < l; idx++ {
|
||||
if x.Path[idx] < xx.Path[idx] {
|
||||
return -1
|
||||
}
|
||||
if x.Path[idx] > xx.Path[idx] {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
if la < lb {
|
||||
return -1
|
||||
}
|
||||
if la > lb {
|
||||
return 1
|
||||
}
|
||||
|
||||
if x.Base < xx.Base {
|
||||
return -1
|
||||
}
|
||||
if x.Base > xx.Base {
|
||||
return -1
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Source) Equal(xx *Source) bool {
|
||||
la, lb := len(x.Path), len(x.Path)
|
||||
if la != lb {
|
||||
return false
|
||||
}
|
||||
|
||||
for idx := 0; idx < la; idx++ {
|
||||
if x.Path[idx] != xx.Path[idx] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
@@ -0,0 +1,362 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.10
|
||||
// source: source.proto
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type SourceFile struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
|
||||
ParentPath string `protobuf:"bytes,2,opt,name=parent_path,json=parentPath,proto3" json:"parent_path,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Mode int64 `protobuf:"varint,17,opt,name=mode,proto3" json:"mode,omitempty"`
|
||||
ModTime int64 `protobuf:"varint,18,opt,name=mod_time,json=modTime,proto3" json:"mod_time,omitempty"`
|
||||
Size int64 `protobuf:"varint,19,opt,name=size,proto3" json:"size,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SourceFile) Reset() {
|
||||
*x = SourceFile{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_source_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SourceFile) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SourceFile) ProtoMessage() {}
|
||||
|
||||
func (x *SourceFile) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_source_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SourceFile.ProtoReflect.Descriptor instead.
|
||||
func (*SourceFile) Descriptor() ([]byte, []int) {
|
||||
return file_source_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *SourceFile) GetPath() string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SourceFile) GetParentPath() string {
|
||||
if x != nil {
|
||||
return x.ParentPath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SourceFile) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *SourceFile) GetMode() int64 {
|
||||
if x != nil {
|
||||
return x.Mode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SourceFile) GetModTime() int64 {
|
||||
if x != nil {
|
||||
return x.ModTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SourceFile) GetSize() int64 {
|
||||
if x != nil {
|
||||
return x.Size
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Source struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Base string `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"`
|
||||
Path []string `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Source) Reset() {
|
||||
*x = Source{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_source_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Source) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Source) ProtoMessage() {}
|
||||
|
||||
func (x *Source) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_source_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Source.ProtoReflect.Descriptor instead.
|
||||
func (*Source) Descriptor() ([]byte, []int) {
|
||||
return file_source_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Source) GetBase() string {
|
||||
if x != nil {
|
||||
return x.Base
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Source) GetPath() []string {
|
||||
if x != nil {
|
||||
return x.Path
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SourceState struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Source *Source `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"`
|
||||
Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
|
||||
Status CopyStatus `protobuf:"varint,3,opt,name=status,proto3,enum=copy_status.CopyStatus" json:"status,omitempty"`
|
||||
Message *string `protobuf:"bytes,4,opt,name=message,proto3,oneof" json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SourceState) Reset() {
|
||||
*x = SourceState{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_source_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SourceState) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SourceState) ProtoMessage() {}
|
||||
|
||||
func (x *SourceState) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_source_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SourceState.ProtoReflect.Descriptor instead.
|
||||
func (*SourceState) Descriptor() ([]byte, []int) {
|
||||
return file_source_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *SourceState) GetSource() *Source {
|
||||
if x != nil {
|
||||
return x.Source
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SourceState) GetSize() int64 {
|
||||
if x != nil {
|
||||
return x.Size
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SourceState) GetStatus() CopyStatus {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return CopyStatus_Draft
|
||||
}
|
||||
|
||||
func (x *SourceState) GetMessage() string {
|
||||
if x != nil && x.Message != nil {
|
||||
return *x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_source_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_source_proto_rawDesc = []byte{
|
||||
0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06,
|
||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0x11, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x01, 0x0a, 0x0a, 0x53, 0x6f,
|
||||
0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b,
|
||||
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a,
|
||||
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
|
||||
0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x6f, 0x64, 0x5f, 0x74, 0x69, 0x6d,
|
||||
0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04,
|
||||
0x73, 0x69, 0x7a, 0x65, 0x22, 0x30, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x61,
|
||||
0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09,
|
||||
0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0xa5, 0x01, 0x0a, 0x0b, 0x53, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e,
|
||||
0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x12,
|
||||
0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69,
|
||||
0x7a, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x0e, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||
0x2e, 0x43, 0x6f, 0x70, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61,
|
||||
0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x88,
|
||||
0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x28,
|
||||
0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x63,
|
||||
0x39, 0x35, 0x30, 0x33, 0x30, 0x39, 0x2f, 0x74, 0x61, 0x70, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65,
|
||||
0x72, 0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_source_proto_rawDescOnce sync.Once
|
||||
file_source_proto_rawDescData = file_source_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_source_proto_rawDescGZIP() []byte {
|
||||
file_source_proto_rawDescOnce.Do(func() {
|
||||
file_source_proto_rawDescData = protoimpl.X.CompressGZIP(file_source_proto_rawDescData)
|
||||
})
|
||||
return file_source_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_source_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_source_proto_goTypes = []interface{}{
|
||||
(*SourceFile)(nil), // 0: source.SourceFile
|
||||
(*Source)(nil), // 1: source.Source
|
||||
(*SourceState)(nil), // 2: source.SourceState
|
||||
(CopyStatus)(0), // 3: copy_status.CopyStatus
|
||||
}
|
||||
var file_source_proto_depIdxs = []int32{
|
||||
1, // 0: source.SourceState.source:type_name -> source.Source
|
||||
3, // 1: source.SourceState.status:type_name -> copy_status.CopyStatus
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
2, // [2:2] is the sub-list for extension extendee
|
||||
0, // [0:2] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_source_proto_init() }
|
||||
func file_source_proto_init() {
|
||||
if File_source_proto != nil {
|
||||
return
|
||||
}
|
||||
file_copy_status_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_source_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SourceFile); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_source_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Source); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_source_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SourceState); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_source_proto_msgTypes[2].OneofWrappers = []interface{}{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_source_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_source_proto_goTypes,
|
||||
DependencyIndexes: file_source_proto_depIdxs,
|
||||
MessageInfos: file_source_proto_msgTypes,
|
||||
}.Build()
|
||||
File_source_proto = out.File
|
||||
file_source_proto_rawDesc = nil
|
||||
file_source_proto_goTypes = nil
|
||||
file_source_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
syntax = "proto3";
|
||||
package source;
|
||||
|
||||
option go_package = "github.com/abc950309/tapewriter/entity";
|
||||
|
||||
import "copy_status.proto";
|
||||
|
||||
message SourceFile {
|
||||
string path = 1;
|
||||
string parent_path = 2;
|
||||
string name = 3;
|
||||
|
||||
int64 mode = 17;
|
||||
int64 mod_time = 18;
|
||||
int64 size = 19;
|
||||
}
|
||||
|
||||
message Source {
|
||||
string base = 1;
|
||||
repeated string path = 2;
|
||||
}
|
||||
|
||||
message SourceState {
|
||||
Source source = 1;
|
||||
int64 size = 2;
|
||||
copy_status.CopyStatus status = 3;
|
||||
optional string message = 4;
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v3.21.10
|
||||
// source: tape.proto
|
||||
|
||||
package entity
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type Tape struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Barcode string `protobuf:"bytes,2,opt,name=barcode,proto3" json:"barcode,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Encryption string `protobuf:"bytes,4,opt,name=encryption,proto3" json:"encryption,omitempty"`
|
||||
CreateTime int64 `protobuf:"varint,17,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
|
||||
DestroyTime *int64 `protobuf:"varint,18,opt,name=destroy_time,json=destroyTime,proto3,oneof" json:"destroy_time,omitempty"`
|
||||
CapacityBytes int64 `protobuf:"varint,19,opt,name=capacity_bytes,json=capacityBytes,proto3" json:"capacity_bytes,omitempty"`
|
||||
WritenBytes int64 `protobuf:"varint,20,opt,name=writen_bytes,json=writenBytes,proto3" json:"writen_bytes,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Tape) Reset() {
|
||||
*x = Tape{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_tape_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Tape) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Tape) ProtoMessage() {}
|
||||
|
||||
func (x *Tape) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_tape_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Tape.ProtoReflect.Descriptor instead.
|
||||
func (*Tape) Descriptor() ([]byte, []int) {
|
||||
return file_tape_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Tape) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Tape) GetBarcode() string {
|
||||
if x != nil {
|
||||
return x.Barcode
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Tape) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Tape) GetEncryption() string {
|
||||
if x != nil {
|
||||
return x.Encryption
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Tape) GetCreateTime() int64 {
|
||||
if x != nil {
|
||||
return x.CreateTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Tape) GetDestroyTime() int64 {
|
||||
if x != nil && x.DestroyTime != nil {
|
||||
return *x.DestroyTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Tape) GetCapacityBytes() int64 {
|
||||
if x != nil {
|
||||
return x.CapacityBytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Tape) GetWritenBytes() int64 {
|
||||
if x != nil {
|
||||
return x.WritenBytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_tape_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_tape_proto_rawDesc = []byte{
|
||||
0x0a, 0x0a, 0x74, 0x61, 0x70, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x74, 0x61,
|
||||
0x70, 0x65, 0x22, 0x88, 0x02, 0x0a, 0x04, 0x54, 0x61, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62,
|
||||
0x61, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61,
|
||||
0x72, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x6e, 0x63,
|
||||
0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x65,
|
||||
0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65,
|
||||
0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a,
|
||||
0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0c, 0x64, 0x65,
|
||||
0x73, 0x74, 0x72, 0x6f, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x03,
|
||||
0x48, 0x00, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x88,
|
||||
0x01, 0x01, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x5f, 0x62,
|
||||
0x79, 0x74, 0x65, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x61, 0x70, 0x61,
|
||||
0x63, 0x69, 0x74, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x72, 0x69,
|
||||
0x74, 0x65, 0x6e, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x6e, 0x42, 0x79, 0x74, 0x65, 0x73, 0x42, 0x0f, 0x0a, 0x0d,
|
||||
0x5f, 0x64, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x28, 0x5a,
|
||||
0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x62, 0x63, 0x39,
|
||||
0x35, 0x30, 0x33, 0x30, 0x39, 0x2f, 0x74, 0x61, 0x70, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x72,
|
||||
0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_tape_proto_rawDescOnce sync.Once
|
||||
file_tape_proto_rawDescData = file_tape_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_tape_proto_rawDescGZIP() []byte {
|
||||
file_tape_proto_rawDescOnce.Do(func() {
|
||||
file_tape_proto_rawDescData = protoimpl.X.CompressGZIP(file_tape_proto_rawDescData)
|
||||
})
|
||||
return file_tape_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_tape_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_tape_proto_goTypes = []interface{}{
|
||||
(*Tape)(nil), // 0: tape.Tape
|
||||
}
|
||||
var file_tape_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_tape_proto_init() }
|
||||
func file_tape_proto_init() {
|
||||
if File_tape_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_tape_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Tape); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_tape_proto_msgTypes[0].OneofWrappers = []interface{}{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_tape_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_tape_proto_goTypes,
|
||||
DependencyIndexes: file_tape_proto_depIdxs,
|
||||
MessageInfos: file_tape_proto_msgTypes,
|
||||
}.Build()
|
||||
File_tape_proto = out.File
|
||||
file_tape_proto_rawDesc = nil
|
||||
file_tape_proto_goTypes = nil
|
||||
file_tape_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
syntax = "proto3";
|
||||
package tape;
|
||||
option go_package = "github.com/abc950309/tapewriter/entity";
|
||||
|
||||
message Tape {
|
||||
int64 id = 1;
|
||||
string barcode = 2;
|
||||
string name = 3;
|
||||
string encryption = 4;
|
||||
|
||||
int64 create_time = 17;
|
||||
optional int64 destroy_time = 18;
|
||||
int64 capacity_bytes = 19;
|
||||
int64 writen_bytes = 20;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"fmt"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
|
||||
"github.com/modern-go/reflect2"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
var (
|
||||
typeMap sync.Map
|
||||
)
|
||||
|
||||
// Scan implement database/sql.Scanner
|
||||
func Scan(dst proto.Message, src interface{}) error {
|
||||
cacheKey := reflect2.RTypeOf(dst)
|
||||
typ, has := loadType(cacheKey)
|
||||
if !has {
|
||||
ptrType := reflect.TypeOf(dst)
|
||||
if ptrType.Kind() != reflect.Ptr {
|
||||
return fmt.Errorf("scan dst is not an ptr, has= %T", dst)
|
||||
}
|
||||
|
||||
typ = reflect2.Type2(ptrType.Elem())
|
||||
storeType(cacheKey, typ)
|
||||
}
|
||||
typ.Set(dst, typ.New())
|
||||
|
||||
var buf []byte
|
||||
switch v := src.(type) {
|
||||
case string:
|
||||
buf = []byte(v)
|
||||
case []byte:
|
||||
buf = v
|
||||
case nil:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("process define extra scanner, unexpected type for i18n, %T", v)
|
||||
}
|
||||
|
||||
if len(buf) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := proto.Unmarshal(buf, dst); err != nil {
|
||||
return fmt.Errorf("process define extra scanner, json unmarshal fail, %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Value implement database/sql/driver.Valuer
|
||||
func Value(src proto.Message) (driver.Value, error) {
|
||||
buf, err := proto.Marshal(src)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("process define extra valuer, json marshal fail, %w", err)
|
||||
}
|
||||
return buf, nil
|
||||
}
|
||||
|
||||
func loadType(key uintptr) (reflect2.Type, bool) {
|
||||
i, has := typeMap.Load(key)
|
||||
if !has {
|
||||
return nil, false
|
||||
}
|
||||
return i.(reflect2.Type), true
|
||||
}
|
||||
|
||||
func storeType(key uintptr, typ reflect2.Type) {
|
||||
typeMap.Store(key, typ)
|
||||
}
|
||||
Reference in New Issue
Block a user