From 3bc047c866374f45f480259c836063c0c81e1c6e Mon Sep 17 00:00:00 2001 From: Nova Date: Thu, 24 Jul 2025 19:18:32 +0330 Subject: [PATCH] fix fetch remote routes && fix core exit --- core/server/gen/libcore.pb.go | 1762 ++++++++++++++++++++++++ core/server/gen/libcore_grpc.pb.go | 691 ++++++++++ include/global/Utils.hpp | 4 +- include/sys/Process.hpp | 1 - include/ui/mainwindow.h | 3 + src/api/gRPC.cpp | 2 +- src/global/HTTPRequestHelper.cpp | 2 +- src/global/Utils.cpp | 19 +- src/sys/Process.cpp | 9 +- src/ui/group/GroupItem.cpp | 2 +- src/ui/group/dialog_edit_group.cpp | 2 +- src/ui/mainwindow.cpp | 70 +- src/ui/mainwindow_grpc.cpp | 2 +- src/ui/profile/ProxyItem.cpp | 2 +- src/ui/profile/dialog_edit_profile.cpp | 4 +- src/ui/setting/dialog_vpn_settings.cpp | 2 +- 16 files changed, 2519 insertions(+), 58 deletions(-) create mode 100644 core/server/gen/libcore.pb.go create mode 100644 core/server/gen/libcore_grpc.pb.go diff --git a/core/server/gen/libcore.pb.go b/core/server/gen/libcore.pb.go new file mode 100644 index 0000000..e2ee848 --- /dev/null +++ b/core/server/gen/libcore.pb.go @@ -0,0 +1,1762 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc v5.29.3 +// source: libcore.proto + +package gen + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 EmptyReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EmptyReq) Reset() { + *x = EmptyReq{} + mi := &file_libcore_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EmptyReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyReq) ProtoMessage() {} + +func (x *EmptyReq) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyReq.ProtoReflect.Descriptor instead. +func (*EmptyReq) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{0} +} + +type EmptyResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *EmptyResp) Reset() { + *x = EmptyResp{} + mi := &file_libcore_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *EmptyResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyResp) ProtoMessage() {} + +func (x *EmptyResp) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyResp.ProtoReflect.Descriptor instead. +func (*EmptyResp) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{1} +} + +type ErrorResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Error *string `protobuf:"bytes,1,opt,name=error,def=" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for ErrorResp fields. +const ( + Default_ErrorResp_Error = string("") +) + +func (x *ErrorResp) Reset() { + *x = ErrorResp{} + mi := &file_libcore_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ErrorResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ErrorResp) ProtoMessage() {} + +func (x *ErrorResp) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ErrorResp.ProtoReflect.Descriptor instead. +func (*ErrorResp) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{2} +} + +func (x *ErrorResp) GetError() string { + if x != nil && x.Error != nil { + return *x.Error + } + return Default_ErrorResp_Error +} + +type LoadConfigReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + CoreConfig *string `protobuf:"bytes,1,opt,name=core_config,json=coreConfig,def=" json:"core_config,omitempty"` + DisableStats *bool `protobuf:"varint,2,opt,name=disable_stats,json=disableStats,def=0" json:"disable_stats,omitempty"` + NeedExtraProcess *bool `protobuf:"varint,3,opt,name=need_extra_process,json=needExtraProcess,def=0" json:"need_extra_process,omitempty"` + ExtraProcessPath *string `protobuf:"bytes,4,opt,name=extra_process_path,json=extraProcessPath,def=" json:"extra_process_path,omitempty"` + ExtraProcessArgs *string `protobuf:"bytes,5,opt,name=extra_process_args,json=extraProcessArgs,def=" json:"extra_process_args,omitempty"` + ExtraProcessConf *string `protobuf:"bytes,6,opt,name=extra_process_conf,json=extraProcessConf,def=" json:"extra_process_conf,omitempty"` + ExtraProcessConfDir *string `protobuf:"bytes,7,opt,name=extra_process_conf_dir,json=extraProcessConfDir,def=" json:"extra_process_conf_dir,omitempty"` + ExtraNoOut *bool `protobuf:"varint,8,opt,name=extra_no_out,json=extraNoOut,def=0" json:"extra_no_out,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for LoadConfigReq fields. +const ( + Default_LoadConfigReq_CoreConfig = string("") + Default_LoadConfigReq_DisableStats = bool(false) + Default_LoadConfigReq_NeedExtraProcess = bool(false) + Default_LoadConfigReq_ExtraProcessPath = string("") + Default_LoadConfigReq_ExtraProcessArgs = string("") + Default_LoadConfigReq_ExtraProcessConf = string("") + Default_LoadConfigReq_ExtraProcessConfDir = string("") + Default_LoadConfigReq_ExtraNoOut = bool(false) +) + +func (x *LoadConfigReq) Reset() { + *x = LoadConfigReq{} + mi := &file_libcore_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *LoadConfigReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoadConfigReq) ProtoMessage() {} + +func (x *LoadConfigReq) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoadConfigReq.ProtoReflect.Descriptor instead. +func (*LoadConfigReq) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{3} +} + +func (x *LoadConfigReq) GetCoreConfig() string { + if x != nil && x.CoreConfig != nil { + return *x.CoreConfig + } + return Default_LoadConfigReq_CoreConfig +} + +func (x *LoadConfigReq) GetDisableStats() bool { + if x != nil && x.DisableStats != nil { + return *x.DisableStats + } + return Default_LoadConfigReq_DisableStats +} + +func (x *LoadConfigReq) GetNeedExtraProcess() bool { + if x != nil && x.NeedExtraProcess != nil { + return *x.NeedExtraProcess + } + return Default_LoadConfigReq_NeedExtraProcess +} + +func (x *LoadConfigReq) GetExtraProcessPath() string { + if x != nil && x.ExtraProcessPath != nil { + return *x.ExtraProcessPath + } + return Default_LoadConfigReq_ExtraProcessPath +} + +func (x *LoadConfigReq) GetExtraProcessArgs() string { + if x != nil && x.ExtraProcessArgs != nil { + return *x.ExtraProcessArgs + } + return Default_LoadConfigReq_ExtraProcessArgs +} + +func (x *LoadConfigReq) GetExtraProcessConf() string { + if x != nil && x.ExtraProcessConf != nil { + return *x.ExtraProcessConf + } + return Default_LoadConfigReq_ExtraProcessConf +} + +func (x *LoadConfigReq) GetExtraProcessConfDir() string { + if x != nil && x.ExtraProcessConfDir != nil { + return *x.ExtraProcessConfDir + } + return Default_LoadConfigReq_ExtraProcessConfDir +} + +func (x *LoadConfigReq) GetExtraNoOut() bool { + if x != nil && x.ExtraNoOut != nil { + return *x.ExtraNoOut + } + return Default_LoadConfigReq_ExtraNoOut +} + +type URLTestResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + OutboundTag *string `protobuf:"bytes,1,opt,name=outbound_tag,json=outboundTag,def=" json:"outbound_tag,omitempty"` + LatencyMs *int32 `protobuf:"varint,2,opt,name=latency_ms,json=latencyMs,def=0" json:"latency_ms,omitempty"` + Error *string `protobuf:"bytes,3,opt,name=error,def=" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for URLTestResp fields. +const ( + Default_URLTestResp_OutboundTag = string("") + Default_URLTestResp_LatencyMs = int32(0) + Default_URLTestResp_Error = string("") +) + +func (x *URLTestResp) Reset() { + *x = URLTestResp{} + mi := &file_libcore_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *URLTestResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*URLTestResp) ProtoMessage() {} + +func (x *URLTestResp) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use URLTestResp.ProtoReflect.Descriptor instead. +func (*URLTestResp) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{4} +} + +func (x *URLTestResp) GetOutboundTag() string { + if x != nil && x.OutboundTag != nil { + return *x.OutboundTag + } + return Default_URLTestResp_OutboundTag +} + +func (x *URLTestResp) GetLatencyMs() int32 { + if x != nil && x.LatencyMs != nil { + return *x.LatencyMs + } + return Default_URLTestResp_LatencyMs +} + +func (x *URLTestResp) GetError() string { + if x != nil && x.Error != nil { + return *x.Error + } + return Default_URLTestResp_Error +} + +type TestReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Config *string `protobuf:"bytes,1,opt,name=config,def=" json:"config,omitempty"` + OutboundTags []string `protobuf:"bytes,2,rep,name=outbound_tags,json=outboundTags" json:"outbound_tags,omitempty"` + UseDefaultOutbound *bool `protobuf:"varint,3,opt,name=use_default_outbound,json=useDefaultOutbound,def=0" json:"use_default_outbound,omitempty"` + Url *string `protobuf:"bytes,4,opt,name=url,def=" json:"url,omitempty"` + TestCurrent *bool `protobuf:"varint,5,opt,name=test_current,json=testCurrent,def=0" json:"test_current,omitempty"` + MaxConcurrency *int32 `protobuf:"varint,6,opt,name=max_concurrency,json=maxConcurrency,def=0" json:"max_concurrency,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for TestReq fields. +const ( + Default_TestReq_Config = string("") + Default_TestReq_UseDefaultOutbound = bool(false) + Default_TestReq_Url = string("") + Default_TestReq_TestCurrent = bool(false) + Default_TestReq_MaxConcurrency = int32(0) +) + +func (x *TestReq) Reset() { + *x = TestReq{} + mi := &file_libcore_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TestReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestReq) ProtoMessage() {} + +func (x *TestReq) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestReq.ProtoReflect.Descriptor instead. +func (*TestReq) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{5} +} + +func (x *TestReq) GetConfig() string { + if x != nil && x.Config != nil { + return *x.Config + } + return Default_TestReq_Config +} + +func (x *TestReq) GetOutboundTags() []string { + if x != nil { + return x.OutboundTags + } + return nil +} + +func (x *TestReq) GetUseDefaultOutbound() bool { + if x != nil && x.UseDefaultOutbound != nil { + return *x.UseDefaultOutbound + } + return Default_TestReq_UseDefaultOutbound +} + +func (x *TestReq) GetUrl() string { + if x != nil && x.Url != nil { + return *x.Url + } + return Default_TestReq_Url +} + +func (x *TestReq) GetTestCurrent() bool { + if x != nil && x.TestCurrent != nil { + return *x.TestCurrent + } + return Default_TestReq_TestCurrent +} + +func (x *TestReq) GetMaxConcurrency() int32 { + if x != nil && x.MaxConcurrency != nil { + return *x.MaxConcurrency + } + return Default_TestReq_MaxConcurrency +} + +type TestResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Results []*URLTestResp `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TestResp) Reset() { + *x = TestResp{} + mi := &file_libcore_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TestResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TestResp) ProtoMessage() {} + +func (x *TestResp) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TestResp.ProtoReflect.Descriptor instead. +func (*TestResp) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{6} +} + +func (x *TestResp) GetResults() []*URLTestResp { + if x != nil { + return x.Results + } + return nil +} + +type QueryStatsResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Ups map[string]int64 `protobuf:"bytes,1,rep,name=ups" json:"ups,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + Downs map[string]int64 `protobuf:"bytes,2,rep,name=downs" json:"downs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QueryStatsResp) Reset() { + *x = QueryStatsResp{} + mi := &file_libcore_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QueryStatsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryStatsResp) ProtoMessage() {} + +func (x *QueryStatsResp) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryStatsResp.ProtoReflect.Descriptor instead. +func (*QueryStatsResp) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{7} +} + +func (x *QueryStatsResp) GetUps() map[string]int64 { + if x != nil { + return x.Ups + } + return nil +} + +func (x *QueryStatsResp) GetDowns() map[string]int64 { + if x != nil { + return x.Downs + } + return nil +} + +type ListConnectionsResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Connections []*ConnectionMetaData `protobuf:"bytes,1,rep,name=connections" json:"connections,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListConnectionsResp) Reset() { + *x = ListConnectionsResp{} + mi := &file_libcore_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListConnectionsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListConnectionsResp) ProtoMessage() {} + +func (x *ListConnectionsResp) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListConnectionsResp.ProtoReflect.Descriptor instead. +func (*ListConnectionsResp) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{8} +} + +func (x *ListConnectionsResp) GetConnections() []*ConnectionMetaData { + if x != nil { + return x.Connections + } + return nil +} + +type ConnectionMetaData struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id *string `protobuf:"bytes,1,opt,name=id,def=" json:"id,omitempty"` + CreatedAt *int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,def=0" json:"created_at,omitempty"` + Upload *int64 `protobuf:"varint,3,opt,name=upload,def=0" json:"upload,omitempty"` + Download *int64 `protobuf:"varint,4,opt,name=download,def=0" json:"download,omitempty"` + Outbound *string `protobuf:"bytes,5,opt,name=outbound,def=" json:"outbound,omitempty"` + Network *string `protobuf:"bytes,6,opt,name=network,def=" json:"network,omitempty"` + Dest *string `protobuf:"bytes,7,opt,name=dest,def=" json:"dest,omitempty"` + Protocol *string `protobuf:"bytes,8,opt,name=protocol,def=" json:"protocol,omitempty"` + Domain *string `protobuf:"bytes,9,opt,name=domain,def=" json:"domain,omitempty"` + Process *string `protobuf:"bytes,10,opt,name=process,def=" json:"process,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for ConnectionMetaData fields. +const ( + Default_ConnectionMetaData_Id = string("") + Default_ConnectionMetaData_CreatedAt = int64(0) + Default_ConnectionMetaData_Upload = int64(0) + Default_ConnectionMetaData_Download = int64(0) + Default_ConnectionMetaData_Outbound = string("") + Default_ConnectionMetaData_Network = string("") + Default_ConnectionMetaData_Dest = string("") + Default_ConnectionMetaData_Protocol = string("") + Default_ConnectionMetaData_Domain = string("") + Default_ConnectionMetaData_Process = string("") +) + +func (x *ConnectionMetaData) Reset() { + *x = ConnectionMetaData{} + mi := &file_libcore_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ConnectionMetaData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConnectionMetaData) ProtoMessage() {} + +func (x *ConnectionMetaData) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConnectionMetaData.ProtoReflect.Descriptor instead. +func (*ConnectionMetaData) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{9} +} + +func (x *ConnectionMetaData) GetId() string { + if x != nil && x.Id != nil { + return *x.Id + } + return Default_ConnectionMetaData_Id +} + +func (x *ConnectionMetaData) GetCreatedAt() int64 { + if x != nil && x.CreatedAt != nil { + return *x.CreatedAt + } + return Default_ConnectionMetaData_CreatedAt +} + +func (x *ConnectionMetaData) GetUpload() int64 { + if x != nil && x.Upload != nil { + return *x.Upload + } + return Default_ConnectionMetaData_Upload +} + +func (x *ConnectionMetaData) GetDownload() int64 { + if x != nil && x.Download != nil { + return *x.Download + } + return Default_ConnectionMetaData_Download +} + +func (x *ConnectionMetaData) GetOutbound() string { + if x != nil && x.Outbound != nil { + return *x.Outbound + } + return Default_ConnectionMetaData_Outbound +} + +func (x *ConnectionMetaData) GetNetwork() string { + if x != nil && x.Network != nil { + return *x.Network + } + return Default_ConnectionMetaData_Network +} + +func (x *ConnectionMetaData) GetDest() string { + if x != nil && x.Dest != nil { + return *x.Dest + } + return Default_ConnectionMetaData_Dest +} + +func (x *ConnectionMetaData) GetProtocol() string { + if x != nil && x.Protocol != nil { + return *x.Protocol + } + return Default_ConnectionMetaData_Protocol +} + +func (x *ConnectionMetaData) GetDomain() string { + if x != nil && x.Domain != nil { + return *x.Domain + } + return Default_ConnectionMetaData_Domain +} + +func (x *ConnectionMetaData) GetProcess() string { + if x != nil && x.Process != nil { + return *x.Process + } + return Default_ConnectionMetaData_Process +} + +type GetGeoIPListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Items []string `protobuf:"bytes,1,rep,name=items" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetGeoIPListResponse) Reset() { + *x = GetGeoIPListResponse{} + mi := &file_libcore_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetGeoIPListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGeoIPListResponse) ProtoMessage() {} + +func (x *GetGeoIPListResponse) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGeoIPListResponse.ProtoReflect.Descriptor instead. +func (*GetGeoIPListResponse) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{10} +} + +func (x *GetGeoIPListResponse) GetItems() []string { + if x != nil { + return x.Items + } + return nil +} + +type GetGeoSiteListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Items []string `protobuf:"bytes,2,rep,name=items" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetGeoSiteListResponse) Reset() { + *x = GetGeoSiteListResponse{} + mi := &file_libcore_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetGeoSiteListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGeoSiteListResponse) ProtoMessage() {} + +func (x *GetGeoSiteListResponse) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGeoSiteListResponse.ProtoReflect.Descriptor instead. +func (*GetGeoSiteListResponse) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{11} +} + +func (x *GetGeoSiteListResponse) GetItems() []string { + if x != nil { + return x.Items + } + return nil +} + +type GeoListRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path *string `protobuf:"bytes,1,opt,name=path,def=" json:"path,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for GeoListRequest fields. +const ( + Default_GeoListRequest_Path = string("") +) + +func (x *GeoListRequest) Reset() { + *x = GeoListRequest{} + mi := &file_libcore_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GeoListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GeoListRequest) ProtoMessage() {} + +func (x *GeoListRequest) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GeoListRequest.ProtoReflect.Descriptor instead. +func (*GeoListRequest) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{12} +} + +func (x *GeoListRequest) GetPath() string { + if x != nil && x.Path != nil { + return *x.Path + } + return Default_GeoListRequest_Path +} + +type CompileGeoIPToSrsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Item *string `protobuf:"bytes,1,opt,name=item,def=" json:"item,omitempty"` + Path *string `protobuf:"bytes,2,opt,name=path,def=" json:"path,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for CompileGeoIPToSrsRequest fields. +const ( + Default_CompileGeoIPToSrsRequest_Item = string("") + Default_CompileGeoIPToSrsRequest_Path = string("") +) + +func (x *CompileGeoIPToSrsRequest) Reset() { + *x = CompileGeoIPToSrsRequest{} + mi := &file_libcore_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CompileGeoIPToSrsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompileGeoIPToSrsRequest) ProtoMessage() {} + +func (x *CompileGeoIPToSrsRequest) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CompileGeoIPToSrsRequest.ProtoReflect.Descriptor instead. +func (*CompileGeoIPToSrsRequest) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{13} +} + +func (x *CompileGeoIPToSrsRequest) GetItem() string { + if x != nil && x.Item != nil { + return *x.Item + } + return Default_CompileGeoIPToSrsRequest_Item +} + +func (x *CompileGeoIPToSrsRequest) GetPath() string { + if x != nil && x.Path != nil { + return *x.Path + } + return Default_CompileGeoIPToSrsRequest_Path +} + +type CompileGeoSiteToSrsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Item *string `protobuf:"bytes,1,opt,name=item,def=" json:"item,omitempty"` + Path *string `protobuf:"bytes,2,opt,name=path,def=" json:"path,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for CompileGeoSiteToSrsRequest fields. +const ( + Default_CompileGeoSiteToSrsRequest_Item = string("") + Default_CompileGeoSiteToSrsRequest_Path = string("") +) + +func (x *CompileGeoSiteToSrsRequest) Reset() { + *x = CompileGeoSiteToSrsRequest{} + mi := &file_libcore_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CompileGeoSiteToSrsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompileGeoSiteToSrsRequest) ProtoMessage() {} + +func (x *CompileGeoSiteToSrsRequest) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CompileGeoSiteToSrsRequest.ProtoReflect.Descriptor instead. +func (*CompileGeoSiteToSrsRequest) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{14} +} + +func (x *CompileGeoSiteToSrsRequest) GetItem() string { + if x != nil && x.Item != nil { + return *x.Item + } + return Default_CompileGeoSiteToSrsRequest_Item +} + +func (x *CompileGeoSiteToSrsRequest) GetPath() string { + if x != nil && x.Path != nil { + return *x.Path + } + return Default_CompileGeoSiteToSrsRequest_Path +} + +type SetSystemDNSRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Clear *bool `protobuf:"varint,1,opt,name=clear,def=0" json:"clear,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for SetSystemDNSRequest fields. +const ( + Default_SetSystemDNSRequest_Clear = bool(false) +) + +func (x *SetSystemDNSRequest) Reset() { + *x = SetSystemDNSRequest{} + mi := &file_libcore_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SetSystemDNSRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetSystemDNSRequest) ProtoMessage() {} + +func (x *SetSystemDNSRequest) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SetSystemDNSRequest.ProtoReflect.Descriptor instead. +func (*SetSystemDNSRequest) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{15} +} + +func (x *SetSystemDNSRequest) GetClear() bool { + if x != nil && x.Clear != nil { + return *x.Clear + } + return Default_SetSystemDNSRequest_Clear +} + +type IsPrivilegedResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + HasPrivilege *bool `protobuf:"varint,1,opt,name=has_privilege,json=hasPrivilege,def=0" json:"has_privilege,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for IsPrivilegedResponse fields. +const ( + Default_IsPrivilegedResponse_HasPrivilege = bool(false) +) + +func (x *IsPrivilegedResponse) Reset() { + *x = IsPrivilegedResponse{} + mi := &file_libcore_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IsPrivilegedResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IsPrivilegedResponse) ProtoMessage() {} + +func (x *IsPrivilegedResponse) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IsPrivilegedResponse.ProtoReflect.Descriptor instead. +func (*IsPrivilegedResponse) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{16} +} + +func (x *IsPrivilegedResponse) GetHasPrivilege() bool { + if x != nil && x.HasPrivilege != nil { + return *x.HasPrivilege + } + return Default_IsPrivilegedResponse_HasPrivilege +} + +type SpeedTestRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Config *string `protobuf:"bytes,1,opt,name=config,def=" json:"config,omitempty"` + OutboundTags []string `protobuf:"bytes,2,rep,name=outbound_tags,json=outboundTags" json:"outbound_tags,omitempty"` + TestCurrent *bool `protobuf:"varint,3,opt,name=test_current,json=testCurrent,def=0" json:"test_current,omitempty"` + UseDefaultOutbound *bool `protobuf:"varint,4,opt,name=use_default_outbound,json=useDefaultOutbound,def=0" json:"use_default_outbound,omitempty"` + TestDownload *bool `protobuf:"varint,5,opt,name=test_download,json=testDownload,def=0" json:"test_download,omitempty"` + TestUpload *bool `protobuf:"varint,6,opt,name=test_upload,json=testUpload,def=0" json:"test_upload,omitempty"` + SimpleDownload *bool `protobuf:"varint,7,opt,name=simple_download,json=simpleDownload,def=0" json:"simple_download,omitempty"` + SimpleDownloadAddr *string `protobuf:"bytes,8,opt,name=simple_download_addr,json=simpleDownloadAddr,def=" json:"simple_download_addr,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for SpeedTestRequest fields. +const ( + Default_SpeedTestRequest_Config = string("") + Default_SpeedTestRequest_TestCurrent = bool(false) + Default_SpeedTestRequest_UseDefaultOutbound = bool(false) + Default_SpeedTestRequest_TestDownload = bool(false) + Default_SpeedTestRequest_TestUpload = bool(false) + Default_SpeedTestRequest_SimpleDownload = bool(false) + Default_SpeedTestRequest_SimpleDownloadAddr = string("") +) + +func (x *SpeedTestRequest) Reset() { + *x = SpeedTestRequest{} + mi := &file_libcore_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SpeedTestRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SpeedTestRequest) ProtoMessage() {} + +func (x *SpeedTestRequest) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SpeedTestRequest.ProtoReflect.Descriptor instead. +func (*SpeedTestRequest) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{17} +} + +func (x *SpeedTestRequest) GetConfig() string { + if x != nil && x.Config != nil { + return *x.Config + } + return Default_SpeedTestRequest_Config +} + +func (x *SpeedTestRequest) GetOutboundTags() []string { + if x != nil { + return x.OutboundTags + } + return nil +} + +func (x *SpeedTestRequest) GetTestCurrent() bool { + if x != nil && x.TestCurrent != nil { + return *x.TestCurrent + } + return Default_SpeedTestRequest_TestCurrent +} + +func (x *SpeedTestRequest) GetUseDefaultOutbound() bool { + if x != nil && x.UseDefaultOutbound != nil { + return *x.UseDefaultOutbound + } + return Default_SpeedTestRequest_UseDefaultOutbound +} + +func (x *SpeedTestRequest) GetTestDownload() bool { + if x != nil && x.TestDownload != nil { + return *x.TestDownload + } + return Default_SpeedTestRequest_TestDownload +} + +func (x *SpeedTestRequest) GetTestUpload() bool { + if x != nil && x.TestUpload != nil { + return *x.TestUpload + } + return Default_SpeedTestRequest_TestUpload +} + +func (x *SpeedTestRequest) GetSimpleDownload() bool { + if x != nil && x.SimpleDownload != nil { + return *x.SimpleDownload + } + return Default_SpeedTestRequest_SimpleDownload +} + +func (x *SpeedTestRequest) GetSimpleDownloadAddr() string { + if x != nil && x.SimpleDownloadAddr != nil { + return *x.SimpleDownloadAddr + } + return Default_SpeedTestRequest_SimpleDownloadAddr +} + +type SpeedTestResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + DlSpeed *string `protobuf:"bytes,1,opt,name=dl_speed,json=dlSpeed,def=" json:"dl_speed,omitempty"` + UlSpeed *string `protobuf:"bytes,2,opt,name=ul_speed,json=ulSpeed,def=" json:"ul_speed,omitempty"` + Latency *int32 `protobuf:"varint,3,opt,name=latency,def=0" json:"latency,omitempty"` + OutboundTag *string `protobuf:"bytes,4,opt,name=outbound_tag,json=outboundTag,def=" json:"outbound_tag,omitempty"` + Error *string `protobuf:"bytes,5,opt,name=error,def=" json:"error,omitempty"` + ServerName *string `protobuf:"bytes,6,opt,name=server_name,json=serverName,def=" json:"server_name,omitempty"` + ServerCountry *string `protobuf:"bytes,7,opt,name=server_country,json=serverCountry,def=" json:"server_country,omitempty"` + Cancelled *bool `protobuf:"varint,8,opt,name=cancelled,def=0" json:"cancelled,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for SpeedTestResult fields. +const ( + Default_SpeedTestResult_DlSpeed = string("") + Default_SpeedTestResult_UlSpeed = string("") + Default_SpeedTestResult_Latency = int32(0) + Default_SpeedTestResult_OutboundTag = string("") + Default_SpeedTestResult_Error = string("") + Default_SpeedTestResult_ServerName = string("") + Default_SpeedTestResult_ServerCountry = string("") + Default_SpeedTestResult_Cancelled = bool(false) +) + +func (x *SpeedTestResult) Reset() { + *x = SpeedTestResult{} + mi := &file_libcore_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SpeedTestResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SpeedTestResult) ProtoMessage() {} + +func (x *SpeedTestResult) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SpeedTestResult.ProtoReflect.Descriptor instead. +func (*SpeedTestResult) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{18} +} + +func (x *SpeedTestResult) GetDlSpeed() string { + if x != nil && x.DlSpeed != nil { + return *x.DlSpeed + } + return Default_SpeedTestResult_DlSpeed +} + +func (x *SpeedTestResult) GetUlSpeed() string { + if x != nil && x.UlSpeed != nil { + return *x.UlSpeed + } + return Default_SpeedTestResult_UlSpeed +} + +func (x *SpeedTestResult) GetLatency() int32 { + if x != nil && x.Latency != nil { + return *x.Latency + } + return Default_SpeedTestResult_Latency +} + +func (x *SpeedTestResult) GetOutboundTag() string { + if x != nil && x.OutboundTag != nil { + return *x.OutboundTag + } + return Default_SpeedTestResult_OutboundTag +} + +func (x *SpeedTestResult) GetError() string { + if x != nil && x.Error != nil { + return *x.Error + } + return Default_SpeedTestResult_Error +} + +func (x *SpeedTestResult) GetServerName() string { + if x != nil && x.ServerName != nil { + return *x.ServerName + } + return Default_SpeedTestResult_ServerName +} + +func (x *SpeedTestResult) GetServerCountry() string { + if x != nil && x.ServerCountry != nil { + return *x.ServerCountry + } + return Default_SpeedTestResult_ServerCountry +} + +func (x *SpeedTestResult) GetCancelled() bool { + if x != nil && x.Cancelled != nil { + return *x.Cancelled + } + return Default_SpeedTestResult_Cancelled +} + +type SpeedTestResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Results []*SpeedTestResult `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SpeedTestResponse) Reset() { + *x = SpeedTestResponse{} + mi := &file_libcore_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SpeedTestResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SpeedTestResponse) ProtoMessage() {} + +func (x *SpeedTestResponse) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SpeedTestResponse.ProtoReflect.Descriptor instead. +func (*SpeedTestResponse) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{19} +} + +func (x *SpeedTestResponse) GetResults() []*SpeedTestResult { + if x != nil { + return x.Results + } + return nil +} + +type QuerySpeedTestResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Result *SpeedTestResult `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"` + IsRunning *bool `protobuf:"varint,2,opt,name=is_running,json=isRunning,def=0" json:"is_running,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +// Default values for QuerySpeedTestResponse fields. +const ( + Default_QuerySpeedTestResponse_IsRunning = bool(false) +) + +func (x *QuerySpeedTestResponse) Reset() { + *x = QuerySpeedTestResponse{} + mi := &file_libcore_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QuerySpeedTestResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuerySpeedTestResponse) ProtoMessage() {} + +func (x *QuerySpeedTestResponse) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[20] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QuerySpeedTestResponse.ProtoReflect.Descriptor instead. +func (*QuerySpeedTestResponse) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{20} +} + +func (x *QuerySpeedTestResponse) GetResult() *SpeedTestResult { + if x != nil { + return x.Result + } + return nil +} + +func (x *QuerySpeedTestResponse) GetIsRunning() bool { + if x != nil && x.IsRunning != nil { + return *x.IsRunning + } + return Default_QuerySpeedTestResponse_IsRunning +} + +type QueryURLTestResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Results []*URLTestResp `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *QueryURLTestResponse) Reset() { + *x = QueryURLTestResponse{} + mi := &file_libcore_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *QueryURLTestResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryURLTestResponse) ProtoMessage() {} + +func (x *QueryURLTestResponse) ProtoReflect() protoreflect.Message { + mi := &file_libcore_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryURLTestResponse.ProtoReflect.Descriptor instead. +func (*QueryURLTestResponse) Descriptor() ([]byte, []int) { + return file_libcore_proto_rawDescGZIP(), []int{21} +} + +func (x *QueryURLTestResponse) GetResults() []*URLTestResp { + if x != nil { + return x.Results + } + return nil +} + +var File_libcore_proto protoreflect.FileDescriptor + +var file_libcore_proto_rawDesc = string([]byte{ + 0x0a, 0x0d, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x07, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x0a, 0x0a, 0x08, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x52, 0x65, 0x71, 0x22, 0x0b, 0x0a, 0x09, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x22, 0x23, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, + 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x83, 0x03, 0x0a, 0x0d, 0x4c, 0x6f, 0x61, 0x64, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x12, 0x21, 0x0a, 0x0b, 0x63, 0x6f, 0x72, 0x65, + 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, + 0x0a, 0x63, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, 0x0a, 0x0d, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x33, 0x0a, 0x12, 0x6e, 0x65, 0x65, 0x64, 0x5f, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x10, 0x6e, 0x65, 0x65, 0x64, + 0x45, 0x78, 0x74, 0x72, 0x61, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x2e, 0x0a, 0x12, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x61, + 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x10, 0x65, 0x78, 0x74, 0x72, + 0x61, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x12, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x61, 0x72, + 0x67, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x10, 0x65, 0x78, 0x74, 0x72, + 0x61, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x41, 0x72, 0x67, 0x73, 0x12, 0x2e, 0x0a, 0x12, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x10, 0x65, 0x78, 0x74, 0x72, + 0x61, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x12, 0x35, 0x0a, 0x16, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x13, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x66, + 0x44, 0x69, 0x72, 0x12, 0x27, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x6e, 0x6f, 0x5f, + 0x6f, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, + 0x52, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x4e, 0x6f, 0x4f, 0x75, 0x74, 0x22, 0x6c, 0x0a, 0x0b, + 0x55, 0x52, 0x4c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x0c, 0x6f, + 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x3a, 0x00, 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, + 0x12, 0x20, 0x0a, 0x0a, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6d, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x3a, 0x01, 0x30, 0x52, 0x09, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, + 0x4d, 0x73, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x3a, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xeb, 0x01, 0x0a, 0x07, 0x54, + 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x61, 0x67, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, + 0x64, 0x54, 0x61, 0x67, 0x73, 0x12, 0x37, 0x0a, 0x14, 0x75, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x12, 0x75, 0x73, 0x65, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, + 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x03, 0x75, + 0x72, 0x6c, 0x12, 0x28, 0x0a, 0x0c, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, + 0x0b, 0x74, 0x65, 0x73, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x0f, + 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x05, 0x3a, 0x01, 0x30, 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x22, 0x3a, 0x0a, 0x08, 0x54, 0x65, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x55, 0x52, 0x4c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x52, 0x07, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x73, 0x22, 0xf0, 0x01, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, + 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x03, 0x75, 0x70, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x55, 0x70, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x75, 0x70, 0x73, 0x12, 0x38, 0x0a, 0x05, 0x64, + 0x6f, 0x77, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6c, 0x69, 0x62, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, + 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x1a, 0x36, 0x0a, 0x08, 0x55, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, + 0x0a, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x54, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x43, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3d, + 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa6, 0x02, + 0x0a, 0x12, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x3a, 0x00, 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x3a, 0x01, 0x30, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x19, 0x0a, 0x06, 0x75, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x3a, 0x01, 0x30, 0x52, 0x06, 0x75, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x12, 0x1d, 0x0a, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x3a, 0x01, 0x30, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, + 0x61, 0x64, 0x12, 0x1c, 0x0a, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0x12, 0x1a, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x3a, 0x00, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x14, 0x0a, 0x04, + 0x64, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x04, 0x64, 0x65, + 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x12, 0x18, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, + 0x3a, 0x00, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x07, 0x70, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x07, 0x70, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x22, 0x2c, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, + 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x22, 0x2e, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x53, 0x69, + 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x22, 0x26, 0x0a, 0x0e, 0x47, 0x65, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x46, 0x0a, 0x18, + 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x54, 0x6f, 0x53, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x14, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x22, 0x48, 0x0a, 0x1a, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, + 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x14, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x3a, 0x00, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x14, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x32, + 0x0a, 0x13, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x05, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x05, 0x63, 0x6c, 0x65, + 0x61, 0x72, 0x22, 0x42, 0x0a, 0x14, 0x49, 0x73, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, + 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x0d, 0x68, 0x61, + 0x73, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0c, 0x68, 0x61, 0x73, 0x50, 0x72, 0x69, + 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x22, 0xec, 0x02, 0x0a, 0x10, 0x53, 0x70, 0x65, 0x65, 0x64, + 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, + 0x64, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x75, + 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, 0x73, 0x12, 0x28, 0x0a, 0x0c, 0x74, 0x65, + 0x73, 0x74, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x43, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x14, 0x75, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x12, 0x75, 0x73, 0x65, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x2a, 0x0a, + 0x0d, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0c, 0x74, 0x65, 0x73, + 0x74, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x26, 0x0a, 0x0b, 0x74, 0x65, 0x73, + 0x74, 0x5f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, + 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x55, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x12, 0x2e, 0x0a, 0x0f, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x64, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, + 0x65, 0x52, 0x0e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, + 0x64, 0x12, 0x32, 0x0a, 0x14, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x5f, 0x64, 0x6f, 0x77, 0x6e, + 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x3a, + 0x00, 0x52, 0x12, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, + 0x64, 0x41, 0x64, 0x64, 0x72, 0x22, 0x96, 0x02, 0x0a, 0x0f, 0x53, 0x70, 0x65, 0x65, 0x64, 0x54, + 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1b, 0x0a, 0x08, 0x64, 0x6c, 0x5f, + 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x07, 0x64, + 0x6c, 0x53, 0x70, 0x65, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x08, 0x75, 0x6c, 0x5f, 0x73, 0x70, 0x65, + 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x07, 0x75, 0x6c, 0x53, 0x70, + 0x65, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x07, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x3a, 0x01, 0x30, 0x52, 0x07, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, + 0x12, 0x23, 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x61, 0x67, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, + 0x6e, 0x64, 0x54, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x21, 0x0a, + 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x3a, 0x00, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x27, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x3a, 0x00, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x23, 0x0a, 0x09, 0x63, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, + 0x6c, 0x73, 0x65, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x22, 0x47, + 0x0a, 0x11, 0x53, 0x70, 0x65, 0x65, 0x64, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, + 0x70, 0x65, 0x65, 0x64, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x70, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x70, 0x65, 0x65, 0x64, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x30, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x70, 0x65, 0x65, + 0x64, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x24, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x09, + 0x69, 0x73, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x22, 0x46, 0x0a, 0x14, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x55, 0x52, 0x4c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x55, 0x52, 0x4c, + 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x32, 0x8d, 0x08, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x16, 0x2e, + 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x04, 0x53, 0x74, 0x6f, + 0x70, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x39, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, + 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x10, 0x2e, 0x6c, 0x69, + 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, + 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x31, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x70, 0x54, 0x65, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x6c, + 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, + 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x40, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x52, 0x4c, 0x54, + 0x65, 0x73, 0x74, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x52, 0x4c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, + 0x61, 0x74, 0x73, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x42, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x17, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, + 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6c, + 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0e, 0x47, + 0x65, 0x74, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x17, 0x2e, + 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x69, + 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x6c, + 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, + 0x6f, 0x49, 0x50, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x4e, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, + 0x6f, 0x53, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x12, 0x23, 0x2e, 0x6c, 0x69, 0x62, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x53, + 0x69, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x12, 0x40, 0x0a, 0x0c, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, + 0x44, 0x4e, 0x53, 0x12, 0x1c, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, + 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x40, 0x0a, 0x0c, 0x49, 0x73, 0x50, 0x72, 0x69, 0x76, 0x69, + 0x6c, 0x65, 0x67, 0x65, 0x64, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x49, 0x73, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x53, 0x70, 0x65, 0x65, 0x64, + 0x54, 0x65, 0x73, 0x74, 0x12, 0x19, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, + 0x70, 0x65, 0x65, 0x64, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1a, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x70, 0x65, 0x65, 0x64, 0x54, + 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x53, 0x70, 0x65, 0x65, 0x64, 0x54, 0x65, 0x73, 0x74, 0x12, 0x11, 0x2e, + 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, + 0x1a, 0x1f, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x70, 0x65, 0x65, 0x64, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x13, 0x48, 0x03, 0x5a, 0x0f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2f, 0x67, 0x65, 0x6e, +}) + +var ( + file_libcore_proto_rawDescOnce sync.Once + file_libcore_proto_rawDescData []byte +) + +func file_libcore_proto_rawDescGZIP() []byte { + file_libcore_proto_rawDescOnce.Do(func() { + file_libcore_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_libcore_proto_rawDesc), len(file_libcore_proto_rawDesc))) + }) + return file_libcore_proto_rawDescData +} + +var file_libcore_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_libcore_proto_goTypes = []any{ + (*EmptyReq)(nil), // 0: libcore.EmptyReq + (*EmptyResp)(nil), // 1: libcore.EmptyResp + (*ErrorResp)(nil), // 2: libcore.ErrorResp + (*LoadConfigReq)(nil), // 3: libcore.LoadConfigReq + (*URLTestResp)(nil), // 4: libcore.URLTestResp + (*TestReq)(nil), // 5: libcore.TestReq + (*TestResp)(nil), // 6: libcore.TestResp + (*QueryStatsResp)(nil), // 7: libcore.QueryStatsResp + (*ListConnectionsResp)(nil), // 8: libcore.ListConnectionsResp + (*ConnectionMetaData)(nil), // 9: libcore.ConnectionMetaData + (*GetGeoIPListResponse)(nil), // 10: libcore.GetGeoIPListResponse + (*GetGeoSiteListResponse)(nil), // 11: libcore.GetGeoSiteListResponse + (*GeoListRequest)(nil), // 12: libcore.GeoListRequest + (*CompileGeoIPToSrsRequest)(nil), // 13: libcore.CompileGeoIPToSrsRequest + (*CompileGeoSiteToSrsRequest)(nil), // 14: libcore.CompileGeoSiteToSrsRequest + (*SetSystemDNSRequest)(nil), // 15: libcore.SetSystemDNSRequest + (*IsPrivilegedResponse)(nil), // 16: libcore.IsPrivilegedResponse + (*SpeedTestRequest)(nil), // 17: libcore.SpeedTestRequest + (*SpeedTestResult)(nil), // 18: libcore.SpeedTestResult + (*SpeedTestResponse)(nil), // 19: libcore.SpeedTestResponse + (*QuerySpeedTestResponse)(nil), // 20: libcore.QuerySpeedTestResponse + (*QueryURLTestResponse)(nil), // 21: libcore.QueryURLTestResponse + nil, // 22: libcore.QueryStatsResp.UpsEntry + nil, // 23: libcore.QueryStatsResp.DownsEntry +} +var file_libcore_proto_depIdxs = []int32{ + 4, // 0: libcore.TestResp.results:type_name -> libcore.URLTestResp + 22, // 1: libcore.QueryStatsResp.ups:type_name -> libcore.QueryStatsResp.UpsEntry + 23, // 2: libcore.QueryStatsResp.downs:type_name -> libcore.QueryStatsResp.DownsEntry + 9, // 3: libcore.ListConnectionsResp.connections:type_name -> libcore.ConnectionMetaData + 18, // 4: libcore.SpeedTestResponse.results:type_name -> libcore.SpeedTestResult + 18, // 5: libcore.QuerySpeedTestResponse.result:type_name -> libcore.SpeedTestResult + 4, // 6: libcore.QueryURLTestResponse.results:type_name -> libcore.URLTestResp + 3, // 7: libcore.LibcoreService.Start:input_type -> libcore.LoadConfigReq + 0, // 8: libcore.LibcoreService.Stop:input_type -> libcore.EmptyReq + 3, // 9: libcore.LibcoreService.CheckConfig:input_type -> libcore.LoadConfigReq + 5, // 10: libcore.LibcoreService.Test:input_type -> libcore.TestReq + 0, // 11: libcore.LibcoreService.StopTest:input_type -> libcore.EmptyReq + 0, // 12: libcore.LibcoreService.QueryURLTest:input_type -> libcore.EmptyReq + 0, // 13: libcore.LibcoreService.QueryStats:input_type -> libcore.EmptyReq + 0, // 14: libcore.LibcoreService.ListConnections:input_type -> libcore.EmptyReq + 12, // 15: libcore.LibcoreService.GetGeoIPList:input_type -> libcore.GeoListRequest + 12, // 16: libcore.LibcoreService.GetGeoSiteList:input_type -> libcore.GeoListRequest + 13, // 17: libcore.LibcoreService.CompileGeoIPToSrs:input_type -> libcore.CompileGeoIPToSrsRequest + 14, // 18: libcore.LibcoreService.CompileGeoSiteToSrs:input_type -> libcore.CompileGeoSiteToSrsRequest + 15, // 19: libcore.LibcoreService.SetSystemDNS:input_type -> libcore.SetSystemDNSRequest + 0, // 20: libcore.LibcoreService.IsPrivileged:input_type -> libcore.EmptyReq + 17, // 21: libcore.LibcoreService.SpeedTest:input_type -> libcore.SpeedTestRequest + 0, // 22: libcore.LibcoreService.QuerySpeedTest:input_type -> libcore.EmptyReq + 2, // 23: libcore.LibcoreService.Start:output_type -> libcore.ErrorResp + 2, // 24: libcore.LibcoreService.Stop:output_type -> libcore.ErrorResp + 2, // 25: libcore.LibcoreService.CheckConfig:output_type -> libcore.ErrorResp + 6, // 26: libcore.LibcoreService.Test:output_type -> libcore.TestResp + 1, // 27: libcore.LibcoreService.StopTest:output_type -> libcore.EmptyResp + 21, // 28: libcore.LibcoreService.QueryURLTest:output_type -> libcore.QueryURLTestResponse + 7, // 29: libcore.LibcoreService.QueryStats:output_type -> libcore.QueryStatsResp + 8, // 30: libcore.LibcoreService.ListConnections:output_type -> libcore.ListConnectionsResp + 10, // 31: libcore.LibcoreService.GetGeoIPList:output_type -> libcore.GetGeoIPListResponse + 11, // 32: libcore.LibcoreService.GetGeoSiteList:output_type -> libcore.GetGeoSiteListResponse + 1, // 33: libcore.LibcoreService.CompileGeoIPToSrs:output_type -> libcore.EmptyResp + 1, // 34: libcore.LibcoreService.CompileGeoSiteToSrs:output_type -> libcore.EmptyResp + 1, // 35: libcore.LibcoreService.SetSystemDNS:output_type -> libcore.EmptyResp + 16, // 36: libcore.LibcoreService.IsPrivileged:output_type -> libcore.IsPrivilegedResponse + 19, // 37: libcore.LibcoreService.SpeedTest:output_type -> libcore.SpeedTestResponse + 20, // 38: libcore.LibcoreService.QuerySpeedTest:output_type -> libcore.QuerySpeedTestResponse + 23, // [23:39] is the sub-list for method output_type + 7, // [7:23] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_libcore_proto_init() } +func file_libcore_proto_init() { + if File_libcore_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_libcore_proto_rawDesc), len(file_libcore_proto_rawDesc)), + NumEnums: 0, + NumMessages: 24, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_libcore_proto_goTypes, + DependencyIndexes: file_libcore_proto_depIdxs, + MessageInfos: file_libcore_proto_msgTypes, + }.Build() + File_libcore_proto = out.File + file_libcore_proto_goTypes = nil + file_libcore_proto_depIdxs = nil +} diff --git a/core/server/gen/libcore_grpc.pb.go b/core/server/gen/libcore_grpc.pb.go new file mode 100644 index 0000000..1985821 --- /dev/null +++ b/core/server/gen/libcore_grpc.pb.go @@ -0,0 +1,691 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 +// source: libcore.proto + +package gen + +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.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + LibcoreService_Start_FullMethodName = "/libcore.LibcoreService/Start" + LibcoreService_Stop_FullMethodName = "/libcore.LibcoreService/Stop" + LibcoreService_CheckConfig_FullMethodName = "/libcore.LibcoreService/CheckConfig" + LibcoreService_Test_FullMethodName = "/libcore.LibcoreService/Test" + LibcoreService_StopTest_FullMethodName = "/libcore.LibcoreService/StopTest" + LibcoreService_QueryURLTest_FullMethodName = "/libcore.LibcoreService/QueryURLTest" + LibcoreService_QueryStats_FullMethodName = "/libcore.LibcoreService/QueryStats" + LibcoreService_ListConnections_FullMethodName = "/libcore.LibcoreService/ListConnections" + LibcoreService_GetGeoIPList_FullMethodName = "/libcore.LibcoreService/GetGeoIPList" + LibcoreService_GetGeoSiteList_FullMethodName = "/libcore.LibcoreService/GetGeoSiteList" + LibcoreService_CompileGeoIPToSrs_FullMethodName = "/libcore.LibcoreService/CompileGeoIPToSrs" + LibcoreService_CompileGeoSiteToSrs_FullMethodName = "/libcore.LibcoreService/CompileGeoSiteToSrs" + LibcoreService_SetSystemDNS_FullMethodName = "/libcore.LibcoreService/SetSystemDNS" + LibcoreService_IsPrivileged_FullMethodName = "/libcore.LibcoreService/IsPrivileged" + LibcoreService_SpeedTest_FullMethodName = "/libcore.LibcoreService/SpeedTest" + LibcoreService_QuerySpeedTest_FullMethodName = "/libcore.LibcoreService/QuerySpeedTest" +) + +// LibcoreServiceClient is the client API for LibcoreService 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 LibcoreServiceClient interface { + Start(ctx context.Context, in *LoadConfigReq, opts ...grpc.CallOption) (*ErrorResp, error) + Stop(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*ErrorResp, error) + CheckConfig(ctx context.Context, in *LoadConfigReq, opts ...grpc.CallOption) (*ErrorResp, error) + Test(ctx context.Context, in *TestReq, opts ...grpc.CallOption) (*TestResp, error) + StopTest(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*EmptyResp, error) + QueryURLTest(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*QueryURLTestResponse, error) + QueryStats(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*QueryStatsResp, error) + ListConnections(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*ListConnectionsResp, error) + GetGeoIPList(ctx context.Context, in *GeoListRequest, opts ...grpc.CallOption) (*GetGeoIPListResponse, error) + GetGeoSiteList(ctx context.Context, in *GeoListRequest, opts ...grpc.CallOption) (*GetGeoSiteListResponse, error) + CompileGeoIPToSrs(ctx context.Context, in *CompileGeoIPToSrsRequest, opts ...grpc.CallOption) (*EmptyResp, error) + CompileGeoSiteToSrs(ctx context.Context, in *CompileGeoSiteToSrsRequest, opts ...grpc.CallOption) (*EmptyResp, error) + SetSystemDNS(ctx context.Context, in *SetSystemDNSRequest, opts ...grpc.CallOption) (*EmptyResp, error) + IsPrivileged(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*IsPrivilegedResponse, error) + SpeedTest(ctx context.Context, in *SpeedTestRequest, opts ...grpc.CallOption) (*SpeedTestResponse, error) + QuerySpeedTest(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*QuerySpeedTestResponse, error) +} + +type libcoreServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewLibcoreServiceClient(cc grpc.ClientConnInterface) LibcoreServiceClient { + return &libcoreServiceClient{cc} +} + +func (c *libcoreServiceClient) Start(ctx context.Context, in *LoadConfigReq, opts ...grpc.CallOption) (*ErrorResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ErrorResp) + err := c.cc.Invoke(ctx, LibcoreService_Start_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) Stop(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*ErrorResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ErrorResp) + err := c.cc.Invoke(ctx, LibcoreService_Stop_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) CheckConfig(ctx context.Context, in *LoadConfigReq, opts ...grpc.CallOption) (*ErrorResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ErrorResp) + err := c.cc.Invoke(ctx, LibcoreService_CheckConfig_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) Test(ctx context.Context, in *TestReq, opts ...grpc.CallOption) (*TestResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(TestResp) + err := c.cc.Invoke(ctx, LibcoreService_Test_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) StopTest(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*EmptyResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(EmptyResp) + err := c.cc.Invoke(ctx, LibcoreService_StopTest_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) QueryURLTest(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*QueryURLTestResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryURLTestResponse) + err := c.cc.Invoke(ctx, LibcoreService_QueryURLTest_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) QueryStats(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*QueryStatsResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QueryStatsResp) + err := c.cc.Invoke(ctx, LibcoreService_QueryStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) ListConnections(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*ListConnectionsResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ListConnectionsResp) + err := c.cc.Invoke(ctx, LibcoreService_ListConnections_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) GetGeoIPList(ctx context.Context, in *GeoListRequest, opts ...grpc.CallOption) (*GetGeoIPListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetGeoIPListResponse) + err := c.cc.Invoke(ctx, LibcoreService_GetGeoIPList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) GetGeoSiteList(ctx context.Context, in *GeoListRequest, opts ...grpc.CallOption) (*GetGeoSiteListResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(GetGeoSiteListResponse) + err := c.cc.Invoke(ctx, LibcoreService_GetGeoSiteList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) CompileGeoIPToSrs(ctx context.Context, in *CompileGeoIPToSrsRequest, opts ...grpc.CallOption) (*EmptyResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(EmptyResp) + err := c.cc.Invoke(ctx, LibcoreService_CompileGeoIPToSrs_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) CompileGeoSiteToSrs(ctx context.Context, in *CompileGeoSiteToSrsRequest, opts ...grpc.CallOption) (*EmptyResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(EmptyResp) + err := c.cc.Invoke(ctx, LibcoreService_CompileGeoSiteToSrs_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) SetSystemDNS(ctx context.Context, in *SetSystemDNSRequest, opts ...grpc.CallOption) (*EmptyResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(EmptyResp) + err := c.cc.Invoke(ctx, LibcoreService_SetSystemDNS_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) IsPrivileged(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*IsPrivilegedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(IsPrivilegedResponse) + err := c.cc.Invoke(ctx, LibcoreService_IsPrivileged_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) SpeedTest(ctx context.Context, in *SpeedTestRequest, opts ...grpc.CallOption) (*SpeedTestResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SpeedTestResponse) + err := c.cc.Invoke(ctx, LibcoreService_SpeedTest_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *libcoreServiceClient) QuerySpeedTest(ctx context.Context, in *EmptyReq, opts ...grpc.CallOption) (*QuerySpeedTestResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(QuerySpeedTestResponse) + err := c.cc.Invoke(ctx, LibcoreService_QuerySpeedTest_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LibcoreServiceServer is the server API for LibcoreService service. +// All implementations must embed UnimplementedLibcoreServiceServer +// for forward compatibility. +type LibcoreServiceServer interface { + Start(context.Context, *LoadConfigReq) (*ErrorResp, error) + Stop(context.Context, *EmptyReq) (*ErrorResp, error) + CheckConfig(context.Context, *LoadConfigReq) (*ErrorResp, error) + Test(context.Context, *TestReq) (*TestResp, error) + StopTest(context.Context, *EmptyReq) (*EmptyResp, error) + QueryURLTest(context.Context, *EmptyReq) (*QueryURLTestResponse, error) + QueryStats(context.Context, *EmptyReq) (*QueryStatsResp, error) + ListConnections(context.Context, *EmptyReq) (*ListConnectionsResp, error) + GetGeoIPList(context.Context, *GeoListRequest) (*GetGeoIPListResponse, error) + GetGeoSiteList(context.Context, *GeoListRequest) (*GetGeoSiteListResponse, error) + CompileGeoIPToSrs(context.Context, *CompileGeoIPToSrsRequest) (*EmptyResp, error) + CompileGeoSiteToSrs(context.Context, *CompileGeoSiteToSrsRequest) (*EmptyResp, error) + SetSystemDNS(context.Context, *SetSystemDNSRequest) (*EmptyResp, error) + IsPrivileged(context.Context, *EmptyReq) (*IsPrivilegedResponse, error) + SpeedTest(context.Context, *SpeedTestRequest) (*SpeedTestResponse, error) + QuerySpeedTest(context.Context, *EmptyReq) (*QuerySpeedTestResponse, error) + mustEmbedUnimplementedLibcoreServiceServer() +} + +// UnimplementedLibcoreServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedLibcoreServiceServer struct{} + +func (UnimplementedLibcoreServiceServer) Start(context.Context, *LoadConfigReq) (*ErrorResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") +} +func (UnimplementedLibcoreServiceServer) Stop(context.Context, *EmptyReq) (*ErrorResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") +} +func (UnimplementedLibcoreServiceServer) CheckConfig(context.Context, *LoadConfigReq) (*ErrorResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckConfig not implemented") +} +func (UnimplementedLibcoreServiceServer) Test(context.Context, *TestReq) (*TestResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method Test not implemented") +} +func (UnimplementedLibcoreServiceServer) StopTest(context.Context, *EmptyReq) (*EmptyResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method StopTest not implemented") +} +func (UnimplementedLibcoreServiceServer) QueryURLTest(context.Context, *EmptyReq) (*QueryURLTestResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryURLTest not implemented") +} +func (UnimplementedLibcoreServiceServer) QueryStats(context.Context, *EmptyReq) (*QueryStatsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryStats not implemented") +} +func (UnimplementedLibcoreServiceServer) ListConnections(context.Context, *EmptyReq) (*ListConnectionsResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListConnections not implemented") +} +func (UnimplementedLibcoreServiceServer) GetGeoIPList(context.Context, *GeoListRequest) (*GetGeoIPListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGeoIPList not implemented") +} +func (UnimplementedLibcoreServiceServer) GetGeoSiteList(context.Context, *GeoListRequest) (*GetGeoSiteListResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetGeoSiteList not implemented") +} +func (UnimplementedLibcoreServiceServer) CompileGeoIPToSrs(context.Context, *CompileGeoIPToSrsRequest) (*EmptyResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CompileGeoIPToSrs not implemented") +} +func (UnimplementedLibcoreServiceServer) CompileGeoSiteToSrs(context.Context, *CompileGeoSiteToSrsRequest) (*EmptyResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method CompileGeoSiteToSrs not implemented") +} +func (UnimplementedLibcoreServiceServer) SetSystemDNS(context.Context, *SetSystemDNSRequest) (*EmptyResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetSystemDNS not implemented") +} +func (UnimplementedLibcoreServiceServer) IsPrivileged(context.Context, *EmptyReq) (*IsPrivilegedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsPrivileged not implemented") +} +func (UnimplementedLibcoreServiceServer) SpeedTest(context.Context, *SpeedTestRequest) (*SpeedTestResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SpeedTest not implemented") +} +func (UnimplementedLibcoreServiceServer) QuerySpeedTest(context.Context, *EmptyReq) (*QuerySpeedTestResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuerySpeedTest not implemented") +} +func (UnimplementedLibcoreServiceServer) mustEmbedUnimplementedLibcoreServiceServer() {} +func (UnimplementedLibcoreServiceServer) testEmbeddedByValue() {} + +// UnsafeLibcoreServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LibcoreServiceServer will +// result in compilation errors. +type UnsafeLibcoreServiceServer interface { + mustEmbedUnimplementedLibcoreServiceServer() +} + +func RegisterLibcoreServiceServer(s grpc.ServiceRegistrar, srv LibcoreServiceServer) { + // If the following call pancis, it indicates UnimplementedLibcoreServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&LibcoreService_ServiceDesc, srv) +} + +func _LibcoreService_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoadConfigReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).Start(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_Start_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).Start(ctx, req.(*LoadConfigReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).Stop(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_Stop_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).Stop(ctx, req.(*EmptyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_CheckConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoadConfigReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).CheckConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_CheckConfig_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).CheckConfig(ctx, req.(*LoadConfigReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_Test_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TestReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).Test(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_Test_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).Test(ctx, req.(*TestReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_StopTest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).StopTest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_StopTest_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).StopTest(ctx, req.(*EmptyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_QueryURLTest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).QueryURLTest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_QueryURLTest_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).QueryURLTest(ctx, req.(*EmptyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_QueryStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).QueryStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_QueryStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).QueryStats(ctx, req.(*EmptyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_ListConnections_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).ListConnections(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_ListConnections_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).ListConnections(ctx, req.(*EmptyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_GetGeoIPList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GeoListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).GetGeoIPList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_GetGeoIPList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).GetGeoIPList(ctx, req.(*GeoListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_GetGeoSiteList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GeoListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).GetGeoSiteList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_GetGeoSiteList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).GetGeoSiteList(ctx, req.(*GeoListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_CompileGeoIPToSrs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CompileGeoIPToSrsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).CompileGeoIPToSrs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_CompileGeoIPToSrs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).CompileGeoIPToSrs(ctx, req.(*CompileGeoIPToSrsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_CompileGeoSiteToSrs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CompileGeoSiteToSrsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).CompileGeoSiteToSrs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_CompileGeoSiteToSrs_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).CompileGeoSiteToSrs(ctx, req.(*CompileGeoSiteToSrsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_SetSystemDNS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetSystemDNSRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).SetSystemDNS(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_SetSystemDNS_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).SetSystemDNS(ctx, req.(*SetSystemDNSRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_IsPrivileged_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).IsPrivileged(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_IsPrivileged_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).IsPrivileged(ctx, req.(*EmptyReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_SpeedTest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SpeedTestRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).SpeedTest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_SpeedTest_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).SpeedTest(ctx, req.(*SpeedTestRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _LibcoreService_QuerySpeedTest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LibcoreServiceServer).QuerySpeedTest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: LibcoreService_QuerySpeedTest_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LibcoreServiceServer).QuerySpeedTest(ctx, req.(*EmptyReq)) + } + return interceptor(ctx, in, info, handler) +} + +// LibcoreService_ServiceDesc is the grpc.ServiceDesc for LibcoreService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LibcoreService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "libcore.LibcoreService", + HandlerType: (*LibcoreServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Start", + Handler: _LibcoreService_Start_Handler, + }, + { + MethodName: "Stop", + Handler: _LibcoreService_Stop_Handler, + }, + { + MethodName: "CheckConfig", + Handler: _LibcoreService_CheckConfig_Handler, + }, + { + MethodName: "Test", + Handler: _LibcoreService_Test_Handler, + }, + { + MethodName: "StopTest", + Handler: _LibcoreService_StopTest_Handler, + }, + { + MethodName: "QueryURLTest", + Handler: _LibcoreService_QueryURLTest_Handler, + }, + { + MethodName: "QueryStats", + Handler: _LibcoreService_QueryStats_Handler, + }, + { + MethodName: "ListConnections", + Handler: _LibcoreService_ListConnections_Handler, + }, + { + MethodName: "GetGeoIPList", + Handler: _LibcoreService_GetGeoIPList_Handler, + }, + { + MethodName: "GetGeoSiteList", + Handler: _LibcoreService_GetGeoSiteList_Handler, + }, + { + MethodName: "CompileGeoIPToSrs", + Handler: _LibcoreService_CompileGeoIPToSrs_Handler, + }, + { + MethodName: "CompileGeoSiteToSrs", + Handler: _LibcoreService_CompileGeoSiteToSrs_Handler, + }, + { + MethodName: "SetSystemDNS", + Handler: _LibcoreService_SetSystemDNS_Handler, + }, + { + MethodName: "IsPrivileged", + Handler: _LibcoreService_IsPrivileged_Handler, + }, + { + MethodName: "SpeedTest", + Handler: _LibcoreService_SpeedTest_Handler, + }, + { + MethodName: "QuerySpeedTest", + Handler: _LibcoreService_QuerySpeedTest_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "libcore.proto", +} diff --git a/include/global/Utils.hpp b/include/global/Utils.hpp index b670ba0..28fc945 100644 --- a/include/global/Utils.hpp +++ b/include/global/Utils.hpp @@ -167,11 +167,11 @@ void ActivateWindow(QWidget *w); // -void runOnUiThread(const std::function &callback, QObject *parent = nullptr); +void runOnUiThread(const std::function &callback); void runOnNewThread(const std::function &callback); -void runOnThread(const std::function &callback, QThread *thread); +void runOnThread(const std::function &callback, QObject *parent); template inline void connectOnce(EMITTER *emitter, SIGNAL signal, RECEIVER *receiver, ReceiverFunc f, diff --git a/include/sys/Process.hpp b/include/sys/Process.hpp index c958d1c..205d2ff 100644 --- a/include/sys/Process.hpp +++ b/include/sys/Process.hpp @@ -35,7 +35,6 @@ namespace Configs_sys { protected: bool started = false; - bool killed = false; bool crashed = false; }; diff --git a/include/ui/mainwindow.h b/include/ui/mainwindow.h index ed0adc1..e3cf794 100644 --- a/include/ui/mainwindow.h +++ b/include/ui/mainwindow.h @@ -209,6 +209,9 @@ private: libcore::SpeedTestResult currentTestResult; DownloadProgressReport currentDownloadReport; // could use a list, but don't think can show more than one anyways + QStringList remoteRouteProfiles; + QMutex mu_remoteRouteProfiles; + QList> get_now_selected_list(); QList> get_selected_or_group(); diff --git a/src/api/gRPC.cpp b/src/api/gRPC.cpp index 8791ce2..9323a82 100644 --- a/src/api/gRPC.cpp +++ b/src/api/gRPC.cpp @@ -155,7 +155,7 @@ namespace QtGrpc { QMutex lock; lock.lock(); - runOnUiThread( + runOnThread( [&] { err = call(methodName, serviceName, requestArray, responseArray, timeout_ms); lock.unlock(); diff --git a/src/global/HTTPRequestHelper.cpp b/src/global/HTTPRequestHelper.cpp index 6b823c8..67d3853 100644 --- a/src/global/HTTPRequestHelper.cpp +++ b/src/global/HTTPRequestHelper.cpp @@ -47,7 +47,7 @@ namespace Configs_network { // Wait for response auto abortTimer = new QTimer; abortTimer->setSingleShot(true); - abortTimer->setInterval(10000); + abortTimer->setInterval(3000); connect(abortTimer, &QTimer::timeout, _reply, &QNetworkReply::abort); abortTimer->start(); { diff --git a/src/global/Utils.cpp b/src/global/Utils.cpp index ed885bf..45504d2 100644 --- a/src/global/Utils.cpp +++ b/src/global/Utils.cpp @@ -249,15 +249,11 @@ void ActivateWindow(QWidget *w) { w->activateWindow(); } -void runOnUiThread(const std::function &callback, QObject *parent) { +void runOnUiThread(const std::function &callback) { // any thread auto *timer = new QTimer(); - auto thread = dynamic_cast(parent); - if (thread == nullptr) { - timer->moveToThread(parent == nullptr ? mainwindow->thread() : parent->thread()); - } else { - timer->moveToThread(thread); - } + auto thread = mainwindow->thread(); + timer->moveToThread(thread); timer->setSingleShot(true); QObject::connect(timer, &QTimer::timeout, [=]() { // main thread @@ -271,9 +267,14 @@ void runOnNewThread(const std::function &callback) { createQThread(callback)->start(); } -void runOnThread(const std::function &callback, QThread *thread) { +void runOnThread(const std::function &callback, QObject *parent) { auto *timer = new QTimer(); - timer->moveToThread(thread); + auto thread = dynamic_cast(parent); + if (thread == nullptr) { + timer->moveToThread(parent->thread()); + } else { + timer->moveToThread(thread); + } timer->setSingleShot(true); QObject::connect(timer, &QTimer::timeout, [=]() { callback(); diff --git a/src/sys/Process.cpp b/src/sys/Process.cpp index eb8439a..c83b4e1 100644 --- a/src/sys/Process.cpp +++ b/src/sys/Process.cpp @@ -10,13 +10,8 @@ namespace Configs_sys { } void CoreProcess::Kill() { - if (killed) return; - killed = true; - - if (!crashed) { - kill(); - waitForFinished(500); - } + kill(); + waitForFinished(); } CoreProcess::CoreProcess(const QString &core_path, const QStringList &args) { diff --git a/src/ui/group/GroupItem.cpp b/src/ui/group/GroupItem.cpp index e6ba51d..ecdf5a3 100644 --- a/src/ui/group/GroupItem.cpp +++ b/src/ui/group/GroupItem.cpp @@ -88,7 +88,7 @@ void GroupItem::refresh_data() { ui->subinfo->setText(info.join(" | ")); } } - runOnUiThread( + runOnThread( [=] { adjustSize(); item->setSizeHint(sizeHint()); diff --git a/src/ui/group/dialog_edit_group.cpp b/src/ui/group/dialog_edit_group.cpp index ee61243..c51a886 100644 --- a/src/ui/group/dialog_edit_group.cpp +++ b/src/ui/group/dialog_edit_group.cpp @@ -7,7 +7,7 @@ #include #include -#define ADJUST_SIZE runOnUiThread([=] { adjustSize(); adjustPosition(mainwindow); }, this); +#define ADJUST_SIZE runOnThread([=] { adjustSize(); adjustPosition(mainwindow); }, this); DialogEditGroup::DialogEditGroup(const std::shared_ptr &ent, QWidget *parent) : QDialog(parent), ui(new Ui::DialogEditGroup) { ui->setupUi(this); diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 731a031..1dba940 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -138,7 +138,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi if (Configs::dataStore->flag_debug) args.push_back("-debug"); // Start core - runOnUiThread( + runOnThread( [=] { core_process = new Configs_sys::CoreProcess(core_path, args); // Remember last started @@ -423,29 +423,36 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi } }); - QStringList profileList; - for(int retry = 0; retry < 3; retry++) { + auto getRemoteRouteProfiles = [=] + { auto resp = NetworkRequestHelper::HttpGet("https://api.github.com/repos/throneproj/routeprofiles/releases/latest"); if (resp.error.isEmpty()) { + QStringList newRemoteRouteProfiles; QJsonObject release = QString2QJsonObject(resp.data); for (const QJsonValue asset : release["assets"].toArray()) { auto profile = asset["name"].toString(); if (profile.section('.', -1) == QString("json") && (profile.startsWith("bypass",Qt::CaseInsensitive) || profile.startsWith("proxy",Qt::CaseInsensitive))) { profile.chop(5); - profileList.push_back(profile); + newRemoteRouteProfiles.push_back(profile); } } - break; + mu_remoteRouteProfiles.lock(); + remoteRouteProfiles = newRemoteRouteProfiles; + mu_remoteRouteProfiles.unlock(); } - } + }; + runOnNewThread(getRemoteRouteProfiles); connect(ui->menuRouting_Menu, &QMenu::aboutToShow, this, [=]() { + // refresh it on every menu show + runOnNewThread(getRemoteRouteProfiles); ui->menuRouting_Menu->clear(); ui->menuRouting_Menu->addAction(ui->menu_routing_settings); - if(!profileList.isEmpty()) { + mu_remoteRouteProfiles.lock(); + if(!remoteRouteProfiles.isEmpty()) { QMenu* profilesMenu = ui->menuRouting_Menu->addMenu(QObject::tr("Download Profiles")); - for (const auto& profile : profileList) + for (const auto& profile : remoteRouteProfiles) { auto* action = new QAction(profilesMenu); action->setText(profile); @@ -461,7 +468,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi auto err = new QString; auto parsed = Configs::RoutingChain::parseJsonArray(QString2QJsonArray(resp.data), err); if (!err->isEmpty()) { - MessageBoxInfo(tr("Invalid JSON Array"), tr("The provided input cannot be parsed to a valid route rule array:\n") + *err); + runOnUiThread([=] + { + MessageBoxInfo(tr("Invalid JSON Array"), tr("The provided input cannot be parsed to a valid route rule array:\n") + *err); + }); return; } auto chain = Configs::ProfileManager::NewRouteChain(); @@ -474,6 +484,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi profilesMenu->addAction(action); } } + mu_remoteRouteProfiles.unlock(); ui->menuRouting_Menu->addSeparator(); for (const auto& route : Configs::profileManager->routes) @@ -843,7 +854,17 @@ void MainWindow::prepare_exit() Configs::dataStore->save_control_no_save = true; // don't change datastore after this line profile_stop(false, true); sem_stopped.acquire(); - core_process->Kill(); + + QMutex coreKillMu; + coreKillMu.lock(); + runOnThread([=, &coreKillMu]() + { + core_process->Kill(); + coreKillMu.unlock(); + }, DS_cores); + coreKillMu.lock(); + coreKillMu.unlock(); + mu_exit.unlock(); qDebug() << "prepare exit done!"; } @@ -2236,27 +2257,16 @@ void MainWindow::HotkeyEvent(const QString &key) { } bool MainWindow::StopVPNProcess() { - vpn_pid = core_process->processId(); - if (vpn_pid != 0) { - bool ok; -#ifdef Q_OS_WIN - auto ret = WinCommander::runProcessElevated("taskkill", {"/F", "/PID", Int2String(vpn_pid)}); - ok = ret == 0; -#endif + QMutex waitStop; + waitStop.lock(); + runOnThread([=, &waitStop] + { + core_process->Kill(); + waitStop.unlock(); + }, DS_cores); + waitStop.lock(); + waitStop.unlock(); -#ifdef Q_OS_MACOS - auto ret = system(QString("osascript -e 'do shell script \"kill -9 %1\"' with administrator privileges").arg(vpn_pid).toStdString().c_str());; - ok = ret == 0; -#endif -#ifdef Q_OS_LINUX - QProcess p; - p.start("pkexec", {"kill", "-9", Int2String(vpn_pid)}); - p.waitForFinished(); - ok = p.exitCode() == 0; -#endif - ok ? vpn_pid = 0 : MessageBoxWarning(tr("Error"), tr("Failed to stop Tun process")); - return ok; - } return true; } diff --git a/src/ui/mainwindow_grpc.cpp b/src/ui/mainwindow_grpc.cpp index d76de32..e76c144 100644 --- a/src/ui/mainwindow_grpc.cpp +++ b/src/ui/mainwindow_grpc.cpp @@ -504,7 +504,7 @@ void MainWindow::profile_start(int _id) { // check core state if (!Configs::dataStore->core_running) { - runOnUiThread( + runOnThread( [=] { MW_show_log(tr("Try to start the config, but the core has not listened to the grpc port, so restart it...")); core_process->start_profile_when_core_is_up = ent->id; diff --git a/src/ui/profile/ProxyItem.cpp b/src/ui/profile/ProxyItem.cpp index 5210173..d80bbfd 100644 --- a/src/ui/profile/ProxyItem.cpp +++ b/src/ui/profile/ProxyItem.cpp @@ -25,7 +25,7 @@ void ProxyItem::refresh_data() { ui->traffic->setText(ent->traffic_data->DisplayTraffic()); ui->test_result->setText(ent->DisplayTestResult()); - runOnUiThread( + runOnThread( [=] { adjustSize(); item->setSizeHint(sizeHint()); diff --git a/src/ui/profile/dialog_edit_profile.cpp b/src/ui/profile/dialog_edit_profile.cpp index 8f3df76..f47a33b 100644 --- a/src/ui/profile/dialog_edit_profile.cpp +++ b/src/ui/profile/dialog_edit_profile.cpp @@ -20,7 +20,7 @@ #include #include -#define ADJUST_SIZE runOnUiThread([=] { adjustSize(); adjustPosition(mainwindow); }, this); +#define ADJUST_SIZE runOnThread([=] { adjustSize(); adjustPosition(mainwindow); }, this); #define LOAD_TYPE(a) ui->type->addItem(Configs::ProfileManager::NewProxyEntity(a)->bean->DisplayType(), a); DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId, QWidget *parent) @@ -397,7 +397,7 @@ void DialogEditProfile::typeSelected(const QString &newType) { // 第一次显示 if (isHidden()) { - runOnUiThread([=] { show(); }, this); + runOnThread([=] { show(); }, this); } } diff --git a/src/ui/setting/dialog_vpn_settings.cpp b/src/ui/setting/dialog_vpn_settings.cpp index cf1b9a0..9925df0 100644 --- a/src/ui/setting/dialog_vpn_settings.cpp +++ b/src/ui/setting/dialog_vpn_settings.cpp @@ -6,7 +6,7 @@ #include "include/ui/mainwindow_interface.h" #include -#define ADJUST_SIZE runOnUiThread([=] { adjustSize(); adjustPosition(mainwindow); }, this); +#define ADJUST_SIZE runOnThread([=] { adjustSize(); adjustPosition(mainwindow); }, this); DialogVPNSettings::DialogVPNSettings(QWidget *parent) : QDialog(parent), ui(new Ui::DialogVPNSettings) { ui->setupUi(this); ADD_ASTERISK(this);