From d446cdf9b11f0460be7882457c36ad1f38f095c1 Mon Sep 17 00:00:00 2001 From: mstmdev Date: Tue, 8 Aug 2023 00:32:32 +0800 Subject: [PATCH] Add the LinkTo field for the FileInfo structure (#228) --- api/auth/auth.pb.go | 2 +- api/info/info.pb.go | 2 +- api/monitor/monitor.pb.go | 40 ++++++++++++++++++++++++--------------- api/proto/monitor.proto | 2 ++ api/task/task.pb.go | 2 +- contract/file_info.go | 2 ++ 6 files changed, 32 insertions(+), 18 deletions(-) diff --git a/api/auth/auth.pb.go b/api/auth/auth.pb.go index e1e51a9..8890fb7 100644 --- a/api/auth/auth.pb.go +++ b/api/auth/auth.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v4.22.2 // source: api/proto/auth.proto diff --git a/api/info/info.pb.go b/api/info/info.pb.go index 3b5a3d4..f08fcbd 100644 --- a/api/info/info.pb.go +++ b/api/info/info.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v4.22.2 // source: api/proto/info.proto diff --git a/api/monitor/monitor.pb.go b/api/monitor/monitor.pb.go index e5ecb41..48e42b5 100644 --- a/api/monitor/monitor.pb.go +++ b/api/monitor/monitor.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v4.22.2 // source: api/proto/monitor.proto @@ -109,6 +109,8 @@ type FileInfo struct { ATime int64 `protobuf:"varint,7,opt,name=a_time,json=aTime,proto3" json:"a_time,omitempty"` // MTime last modify time, unix sec MTime int64 `protobuf:"varint,8,opt,name=m_time,json=mTime,proto3" json:"m_time,omitempty"` + // LinkTo link to the real file + LinkTo string `protobuf:"bytes,9,opt,name=link_to,json=linkTo,proto3" json:"link_to,omitempty"` } func (x *FileInfo) Reset() { @@ -199,6 +201,13 @@ func (x *FileInfo) GetMTime() int64 { return 0 } +func (x *FileInfo) GetLinkTo() string { + if x != nil { + return x.LinkTo + } + return "" +} + // HashValue the file hash info type HashValue struct { state protoimpl.MessageState @@ -271,7 +280,7 @@ var file_api_proto_monitor_proto_rawDesc = []byte{ 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x73, - 0x65, 0x55, 0x72, 0x6c, 0x22, 0xd7, 0x01, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x6e, 0x66, + 0x65, 0x55, 0x72, 0x6c, 0x22, 0xf0, 0x01, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x73, 0x44, 0x69, 0x72, 0x12, 0x12, 0x0a, 0x04, @@ -284,19 +293,20 @@ var file_api_proto_monitor_proto_rawDesc = []byte{ 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x6d, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x37, - 0x0a, 0x09, 0x48, 0x61, 0x73, 0x68, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, - 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, - 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x32, 0x50, 0x0a, 0x0e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x4d, 0x6f, 0x6e, - 0x69, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x6d, - 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x6f, 0x2d, 0x73, 0x72, 0x63, 0x2f, 0x67, - 0x6f, 0x66, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x17, + 0x0a, 0x07, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x74, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x6c, 0x69, 0x6e, 0x6b, 0x54, 0x6f, 0x22, 0x37, 0x0a, 0x09, 0x48, 0x61, 0x73, 0x68, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, + 0x32, 0x50, 0x0a, 0x0e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x17, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x2e, + 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, + 0x30, 0x01, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x6e, 0x6f, 0x2d, 0x73, 0x72, 0x63, 0x2f, 0x67, 0x6f, 0x66, 0x73, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/proto/monitor.proto b/api/proto/monitor.proto index 18b8e6b..0f0493d 100644 --- a/api/proto/monitor.proto +++ b/api/proto/monitor.proto @@ -39,6 +39,8 @@ message FileInfo{ int64 a_time = 7; // MTime last modify time, unix sec int64 m_time = 8; + // LinkTo link to the real file + string link_to = 9; } // HashValue the file hash info diff --git a/api/task/task.pb.go b/api/task/task.pb.go index 1f212d3..1179f19 100644 --- a/api/task/task.pb.go +++ b/api/task/task.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.30.0 +// protoc-gen-go v1.31.0 // protoc v4.22.2 // source: api/proto/task.proto diff --git a/contract/file_info.go b/contract/file_info.go index 683e225..116fce0 100644 --- a/contract/file_info.go +++ b/contract/file_info.go @@ -20,4 +20,6 @@ type FileInfo struct { ATime int64 `json:"a_time"` // MTime last modify time, unix sec MTime int64 `json:"m_time"` + // LinkTo link to the real file + LinkTo string `json:"link_to"` } -- GitLab