new: Extensions v0
This commit is contained in:
307
hiddifyrpc/base.pb.go
Normal file
307
hiddifyrpc/base.pb.go
Normal file
@@ -0,0 +1,307 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.2
|
||||
// protoc v5.28.0
|
||||
// source: base.proto
|
||||
|
||||
package hiddifyrpc
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ResponseCode int32
|
||||
|
||||
const (
|
||||
ResponseCode_OK ResponseCode = 0
|
||||
ResponseCode_FAILED ResponseCode = 1
|
||||
)
|
||||
|
||||
// Enum value maps for ResponseCode.
|
||||
var (
|
||||
ResponseCode_name = map[int32]string{
|
||||
0: "OK",
|
||||
1: "FAILED",
|
||||
}
|
||||
ResponseCode_value = map[string]int32{
|
||||
"OK": 0,
|
||||
"FAILED": 1,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ResponseCode) Enum() *ResponseCode {
|
||||
p := new(ResponseCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ResponseCode) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ResponseCode) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_base_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (ResponseCode) Type() protoreflect.EnumType {
|
||||
return &file_base_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x ResponseCode) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ResponseCode.Descriptor instead.
|
||||
func (ResponseCode) EnumDescriptor() ([]byte, []int) {
|
||||
return file_base_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type HelloRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *HelloRequest) Reset() {
|
||||
*x = HelloRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_base_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *HelloRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HelloRequest) ProtoMessage() {}
|
||||
|
||||
func (x *HelloRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_base_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
|
||||
func (*HelloRequest) Descriptor() ([]byte, []int) {
|
||||
return file_base_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *HelloRequest) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type HelloResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func (x *HelloResponse) Reset() {
|
||||
*x = HelloResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_base_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *HelloResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HelloResponse) ProtoMessage() {}
|
||||
|
||||
func (x *HelloResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_base_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.
|
||||
func (*HelloResponse) Descriptor() ([]byte, []int) {
|
||||
return file_base_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *HelloResponse) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Empty struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *Empty) Reset() {
|
||||
*x = Empty{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_base_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Empty) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Empty) ProtoMessage() {}
|
||||
|
||||
func (x *Empty) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_base_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
|
||||
func (*Empty) Descriptor() ([]byte, []int) {
|
||||
return file_base_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
var File_base_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_base_proto_rawDesc = []byte{
|
||||
0x0a, 0x0a, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x68, 0x69,
|
||||
0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x22, 0x22, 0x0a, 0x0c, 0x48, 0x65, 0x6c, 0x6c,
|
||||
0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x0a, 0x0d,
|
||||
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79,
|
||||
0x2a, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65,
|
||||
0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c,
|
||||
0x45, 0x44, 0x10, 0x01, 0x42, 0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
|
||||
0x79, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_base_proto_rawDescOnce sync.Once
|
||||
file_base_proto_rawDescData = file_base_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_base_proto_rawDescGZIP() []byte {
|
||||
file_base_proto_rawDescOnce.Do(func() {
|
||||
file_base_proto_rawDescData = protoimpl.X.CompressGZIP(file_base_proto_rawDescData)
|
||||
})
|
||||
return file_base_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_base_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_base_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_base_proto_goTypes = []any{
|
||||
(ResponseCode)(0), // 0: hiddifyrpc.ResponseCode
|
||||
(*HelloRequest)(nil), // 1: hiddifyrpc.HelloRequest
|
||||
(*HelloResponse)(nil), // 2: hiddifyrpc.HelloResponse
|
||||
(*Empty)(nil), // 3: hiddifyrpc.Empty
|
||||
}
|
||||
var file_base_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_base_proto_init() }
|
||||
func file_base_proto_init() {
|
||||
if File_base_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_base_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*HelloRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_base_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*HelloResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_base_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*Empty); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_base_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_base_proto_goTypes,
|
||||
DependencyIndexes: file_base_proto_depIdxs,
|
||||
EnumInfos: file_base_proto_enumTypes,
|
||||
MessageInfos: file_base_proto_msgTypes,
|
||||
}.Build()
|
||||
File_base_proto = out.File
|
||||
file_base_proto_rawDesc = nil
|
||||
file_base_proto_goTypes = nil
|
||||
file_base_proto_depIdxs = nil
|
||||
}
|
||||
21
hiddifyrpc/base.proto
Normal file
21
hiddifyrpc/base.proto
Normal file
@@ -0,0 +1,21 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package hiddifyrpc;
|
||||
|
||||
option go_package = "./hiddifyrpc";
|
||||
|
||||
message HelloRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message HelloResponse {
|
||||
string message = 1;
|
||||
}
|
||||
|
||||
message Empty {
|
||||
}
|
||||
|
||||
enum ResponseCode {
|
||||
OK = 0;
|
||||
FAILED = 1;
|
||||
}
|
||||
674
hiddifyrpc/extension.pb.go
Normal file
674
hiddifyrpc/extension.pb.go
Normal file
@@ -0,0 +1,674 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.34.2
|
||||
// protoc v5.28.0
|
||||
// source: extension.proto
|
||||
|
||||
package hiddifyrpc
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type ExtensionResponseType int32
|
||||
|
||||
const (
|
||||
ExtensionResponseType_NOTHING ExtensionResponseType = 0
|
||||
ExtensionResponseType_UPDATE_UI ExtensionResponseType = 1
|
||||
ExtensionResponseType_SHOW_DIALOG ExtensionResponseType = 2
|
||||
ExtensionResponseType_END ExtensionResponseType = 3
|
||||
)
|
||||
|
||||
// Enum value maps for ExtensionResponseType.
|
||||
var (
|
||||
ExtensionResponseType_name = map[int32]string{
|
||||
0: "NOTHING",
|
||||
1: "UPDATE_UI",
|
||||
2: "SHOW_DIALOG",
|
||||
3: "END",
|
||||
}
|
||||
ExtensionResponseType_value = map[string]int32{
|
||||
"NOTHING": 0,
|
||||
"UPDATE_UI": 1,
|
||||
"SHOW_DIALOG": 2,
|
||||
"END": 3,
|
||||
}
|
||||
)
|
||||
|
||||
func (x ExtensionResponseType) Enum() *ExtensionResponseType {
|
||||
p := new(ExtensionResponseType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x ExtensionResponseType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (ExtensionResponseType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_extension_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (ExtensionResponseType) Type() protoreflect.EnumType {
|
||||
return &file_extension_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x ExtensionResponseType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ExtensionResponseType.Descriptor instead.
|
||||
func (ExtensionResponseType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_extension_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type ExtensionActionResult struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ExtensionId string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"`
|
||||
Code ResponseCode `protobuf:"varint,2,opt,name=code,proto3,enum=hiddifyrpc.ResponseCode" json:"code,omitempty"`
|
||||
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ExtensionActionResult) Reset() {
|
||||
*x = ExtensionActionResult{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_extension_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ExtensionActionResult) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExtensionActionResult) ProtoMessage() {}
|
||||
|
||||
func (x *ExtensionActionResult) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_extension_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ExtensionActionResult.ProtoReflect.Descriptor instead.
|
||||
func (*ExtensionActionResult) Descriptor() ([]byte, []int) {
|
||||
return file_extension_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ExtensionActionResult) GetExtensionId() string {
|
||||
if x != nil {
|
||||
return x.ExtensionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ExtensionActionResult) GetCode() ResponseCode {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return ResponseCode_OK
|
||||
}
|
||||
|
||||
func (x *ExtensionActionResult) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ExtensionList struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Extensions []*Extension `protobuf:"bytes,1,rep,name=extensions,proto3" json:"extensions,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ExtensionList) Reset() {
|
||||
*x = ExtensionList{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_extension_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ExtensionList) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExtensionList) ProtoMessage() {}
|
||||
|
||||
func (x *ExtensionList) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_extension_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ExtensionList.ProtoReflect.Descriptor instead.
|
||||
func (*ExtensionList) Descriptor() ([]byte, []int) {
|
||||
return file_extension_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *ExtensionList) GetExtensions() []*Extension {
|
||||
if x != nil {
|
||||
return x.Extensions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type EditExtensionRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ExtensionId string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"`
|
||||
Enable bool `protobuf:"varint,2,opt,name=enable,proto3" json:"enable,omitempty"`
|
||||
}
|
||||
|
||||
func (x *EditExtensionRequest) Reset() {
|
||||
*x = EditExtensionRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_extension_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *EditExtensionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*EditExtensionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *EditExtensionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_extension_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use EditExtensionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*EditExtensionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_extension_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *EditExtensionRequest) GetExtensionId() string {
|
||||
if x != nil {
|
||||
return x.ExtensionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *EditExtensionRequest) GetEnable() bool {
|
||||
if x != nil {
|
||||
return x.Enable
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type Extension struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
|
||||
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
|
||||
Enable bool `protobuf:"varint,4,opt,name=enable,proto3" json:"enable,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Extension) Reset() {
|
||||
*x = Extension{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_extension_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Extension) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Extension) ProtoMessage() {}
|
||||
|
||||
func (x *Extension) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_extension_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Extension.ProtoReflect.Descriptor instead.
|
||||
func (*Extension) Descriptor() ([]byte, []int) {
|
||||
return file_extension_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *Extension) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Extension) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Extension) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Extension) GetEnable() bool {
|
||||
if x != nil {
|
||||
return x.Enable
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ExtensionRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ExtensionId string `protobuf:"bytes,1,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"`
|
||||
Data map[string]string `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
}
|
||||
|
||||
func (x *ExtensionRequest) Reset() {
|
||||
*x = ExtensionRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_extension_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ExtensionRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExtensionRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ExtensionRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_extension_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ExtensionRequest.ProtoReflect.Descriptor instead.
|
||||
func (*ExtensionRequest) Descriptor() ([]byte, []int) {
|
||||
return file_extension_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *ExtensionRequest) GetExtensionId() string {
|
||||
if x != nil {
|
||||
return x.ExtensionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ExtensionRequest) GetData() map[string]string {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ExtensionResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Type ExtensionResponseType `protobuf:"varint,1,opt,name=type,proto3,enum=hiddifyrpc.ExtensionResponseType" json:"type,omitempty"`
|
||||
ExtensionId string `protobuf:"bytes,2,opt,name=extension_id,json=extensionId,proto3" json:"extension_id,omitempty"`
|
||||
JsonUi string `protobuf:"bytes,3,opt,name=json_ui,json=jsonUi,proto3" json:"json_ui,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ExtensionResponse) Reset() {
|
||||
*x = ExtensionResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_extension_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ExtensionResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ExtensionResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ExtensionResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_extension_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ExtensionResponse.ProtoReflect.Descriptor instead.
|
||||
func (*ExtensionResponse) Descriptor() ([]byte, []int) {
|
||||
return file_extension_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *ExtensionResponse) GetType() ExtensionResponseType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return ExtensionResponseType_NOTHING
|
||||
}
|
||||
|
||||
func (x *ExtensionResponse) GetExtensionId() string {
|
||||
if x != nil {
|
||||
return x.ExtensionId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ExtensionResponse) GetJsonUi() string {
|
||||
if x != nil {
|
||||
return x.JsonUi
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_extension_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_extension_proto_rawDesc = []byte{
|
||||
0x0a, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x12, 0x0a, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x1a, 0x0a, 0x62,
|
||||
0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x82, 0x01, 0x0a, 0x15, 0x45, 0x78,
|
||||
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73,
|
||||
0x75, 0x6c, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70,
|
||||
0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04,
|
||||
0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x46,
|
||||
0x0a, 0x0d, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12,
|
||||
0x35, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x65, 0x78, 0x74, 0x65,
|
||||
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x51, 0x0a, 0x14, 0x45, 0x64, 0x69, 0x74, 0x45, 0x78,
|
||||
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21,
|
||||
0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x49,
|
||||
0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x6b, 0x0a, 0x09, 0x45, 0x78, 0x74,
|
||||
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b,
|
||||
0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16,
|
||||
0x0a, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06,
|
||||
0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x10, 0x45, 0x78, 0x74, 0x65, 0x6e,
|
||||
0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x65,
|
||||
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x3a,
|
||||
0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x68,
|
||||
0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45,
|
||||
0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61,
|
||||
0x74, 0x61, 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, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
||||
0x02, 0x38, 0x01, 0x22, 0x86, 0x01, 0x0a, 0x11, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70,
|
||||
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66,
|
||||
0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65,
|
||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
|
||||
0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x75, 0x69, 0x18, 0x03,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6a, 0x73, 0x6f, 0x6e, 0x55, 0x69, 0x2a, 0x4d, 0x0a, 0x15,
|
||||
0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x4f, 0x54, 0x48, 0x49, 0x4e, 0x47,
|
||||
0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x49, 0x10,
|
||||
0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x48, 0x4f, 0x57, 0x5f, 0x44, 0x49, 0x41, 0x4c, 0x4f, 0x47,
|
||||
0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x45, 0x4e, 0x44, 0x10, 0x03, 0x32, 0xb1, 0x04, 0x0a, 0x14,
|
||||
0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65,
|
||||
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x11, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
|
||||
0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x68, 0x69, 0x64, 0x64,
|
||||
0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
|
||||
0x74, 0x12, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45,
|
||||
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x1d, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74,
|
||||
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
||||
0x30, 0x01, 0x12, 0x56, 0x0a, 0x0d, 0x45, 0x64, 0x69, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x45, 0x64, 0x69, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72,
|
||||
0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0a, 0x53, 0x75,
|
||||
0x62, 0x6d, 0x69, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x12, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69,
|
||||
0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79,
|
||||
0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x06, 0x43,
|
||||
0x61, 0x6e, 0x63, 0x65, 0x6c, 0x12, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72,
|
||||
0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63,
|
||||
0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70,
|
||||
0x12, 0x1c, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78,
|
||||
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21,
|
||||
0x2e, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65,
|
||||
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c,
|
||||
0x74, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x05, 0x47, 0x65, 0x74, 0x55, 0x49, 0x12, 0x1c, 0x2e, 0x68,
|
||||
0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
|
||||
0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x68, 0x69, 0x64,
|
||||
0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
|
||||
0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x42,
|
||||
0x0e, 0x5a, 0x0c, 0x2e, 0x2f, 0x68, 0x69, 0x64, 0x64, 0x69, 0x66, 0x79, 0x72, 0x70, 0x63, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_extension_proto_rawDescOnce sync.Once
|
||||
file_extension_proto_rawDescData = file_extension_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_extension_proto_rawDescGZIP() []byte {
|
||||
file_extension_proto_rawDescOnce.Do(func() {
|
||||
file_extension_proto_rawDescData = protoimpl.X.CompressGZIP(file_extension_proto_rawDescData)
|
||||
})
|
||||
return file_extension_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_extension_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_extension_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_extension_proto_goTypes = []any{
|
||||
(ExtensionResponseType)(0), // 0: hiddifyrpc.ExtensionResponseType
|
||||
(*ExtensionActionResult)(nil), // 1: hiddifyrpc.ExtensionActionResult
|
||||
(*ExtensionList)(nil), // 2: hiddifyrpc.ExtensionList
|
||||
(*EditExtensionRequest)(nil), // 3: hiddifyrpc.EditExtensionRequest
|
||||
(*Extension)(nil), // 4: hiddifyrpc.Extension
|
||||
(*ExtensionRequest)(nil), // 5: hiddifyrpc.ExtensionRequest
|
||||
(*ExtensionResponse)(nil), // 6: hiddifyrpc.ExtensionResponse
|
||||
nil, // 7: hiddifyrpc.ExtensionRequest.DataEntry
|
||||
(ResponseCode)(0), // 8: hiddifyrpc.ResponseCode
|
||||
(*Empty)(nil), // 9: hiddifyrpc.Empty
|
||||
}
|
||||
var file_extension_proto_depIdxs = []int32{
|
||||
8, // 0: hiddifyrpc.ExtensionActionResult.code:type_name -> hiddifyrpc.ResponseCode
|
||||
4, // 1: hiddifyrpc.ExtensionList.extensions:type_name -> hiddifyrpc.Extension
|
||||
7, // 2: hiddifyrpc.ExtensionRequest.data:type_name -> hiddifyrpc.ExtensionRequest.DataEntry
|
||||
0, // 3: hiddifyrpc.ExtensionResponse.type:type_name -> hiddifyrpc.ExtensionResponseType
|
||||
9, // 4: hiddifyrpc.ExtensionHostService.ListExtensions:input_type -> hiddifyrpc.Empty
|
||||
5, // 5: hiddifyrpc.ExtensionHostService.Connect:input_type -> hiddifyrpc.ExtensionRequest
|
||||
3, // 6: hiddifyrpc.ExtensionHostService.EditExtension:input_type -> hiddifyrpc.EditExtensionRequest
|
||||
5, // 7: hiddifyrpc.ExtensionHostService.SubmitForm:input_type -> hiddifyrpc.ExtensionRequest
|
||||
5, // 8: hiddifyrpc.ExtensionHostService.Cancel:input_type -> hiddifyrpc.ExtensionRequest
|
||||
5, // 9: hiddifyrpc.ExtensionHostService.Stop:input_type -> hiddifyrpc.ExtensionRequest
|
||||
5, // 10: hiddifyrpc.ExtensionHostService.GetUI:input_type -> hiddifyrpc.ExtensionRequest
|
||||
2, // 11: hiddifyrpc.ExtensionHostService.ListExtensions:output_type -> hiddifyrpc.ExtensionList
|
||||
6, // 12: hiddifyrpc.ExtensionHostService.Connect:output_type -> hiddifyrpc.ExtensionResponse
|
||||
1, // 13: hiddifyrpc.ExtensionHostService.EditExtension:output_type -> hiddifyrpc.ExtensionActionResult
|
||||
1, // 14: hiddifyrpc.ExtensionHostService.SubmitForm:output_type -> hiddifyrpc.ExtensionActionResult
|
||||
1, // 15: hiddifyrpc.ExtensionHostService.Cancel:output_type -> hiddifyrpc.ExtensionActionResult
|
||||
1, // 16: hiddifyrpc.ExtensionHostService.Stop:output_type -> hiddifyrpc.ExtensionActionResult
|
||||
1, // 17: hiddifyrpc.ExtensionHostService.GetUI:output_type -> hiddifyrpc.ExtensionActionResult
|
||||
11, // [11:18] is the sub-list for method output_type
|
||||
4, // [4:11] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_extension_proto_init() }
|
||||
func file_extension_proto_init() {
|
||||
if File_extension_proto != nil {
|
||||
return
|
||||
}
|
||||
file_base_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_extension_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*ExtensionActionResult); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_extension_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*ExtensionList); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_extension_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*EditExtensionRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_extension_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*Extension); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_extension_proto_msgTypes[4].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*ExtensionRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_extension_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||
switch v := v.(*ExtensionResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_extension_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 7,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_extension_proto_goTypes,
|
||||
DependencyIndexes: file_extension_proto_depIdxs,
|
||||
EnumInfos: file_extension_proto_enumTypes,
|
||||
MessageInfos: file_extension_proto_msgTypes,
|
||||
}.Build()
|
||||
File_extension_proto = out.File
|
||||
file_extension_proto_rawDesc = nil
|
||||
file_extension_proto_goTypes = nil
|
||||
file_extension_proto_depIdxs = nil
|
||||
}
|
||||
61
hiddifyrpc/extension.proto
Normal file
61
hiddifyrpc/extension.proto
Normal file
@@ -0,0 +1,61 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "base.proto";
|
||||
|
||||
package hiddifyrpc;
|
||||
|
||||
option go_package = "./hiddifyrpc";
|
||||
|
||||
service ExtensionHostService {
|
||||
rpc ListExtensions (Empty) returns (ExtensionList) {}
|
||||
rpc Connect (ExtensionRequest) returns (stream ExtensionResponse) {}
|
||||
rpc EditExtension (EditExtensionRequest) returns (ExtensionActionResult) {}
|
||||
rpc SubmitForm (ExtensionRequest) returns (ExtensionActionResult) {}
|
||||
rpc Cancel (ExtensionRequest) returns (ExtensionActionResult) {}
|
||||
rpc Stop (ExtensionRequest) returns (ExtensionActionResult) {}
|
||||
|
||||
rpc GetUI (ExtensionRequest) returns (ExtensionActionResult) {}
|
||||
}
|
||||
|
||||
message ExtensionActionResult {
|
||||
string extension_id = 1;
|
||||
ResponseCode code = 2;
|
||||
string message = 3;
|
||||
}
|
||||
|
||||
message ExtensionList {
|
||||
repeated Extension extensions = 1;
|
||||
}
|
||||
|
||||
message EditExtensionRequest {
|
||||
string extension_id = 1;
|
||||
bool enable = 2;
|
||||
}
|
||||
|
||||
message Extension {
|
||||
string id = 1;
|
||||
string title = 2;
|
||||
string description = 3;
|
||||
bool enable = 4;
|
||||
}
|
||||
|
||||
message ExtensionRequest {
|
||||
string extension_id = 1;
|
||||
map<string, string> data = 2;
|
||||
}
|
||||
|
||||
message ExtensionResponse {
|
||||
ExtensionResponseType type = 1;
|
||||
string extension_id = 2;
|
||||
string json_ui = 3;
|
||||
}
|
||||
|
||||
|
||||
enum ExtensionResponseType {
|
||||
NOTHING = 0;
|
||||
UPDATE_UI = 1;
|
||||
SHOW_DIALOG = 2;
|
||||
END=3;
|
||||
}
|
||||
|
||||
|
||||
353
hiddifyrpc/extension_grpc.pb.go
Normal file
353
hiddifyrpc/extension_grpc.pb.go
Normal file
@@ -0,0 +1,353 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v5.28.0
|
||||
// source: extension.proto
|
||||
|
||||
package hiddifyrpc
|
||||
|
||||
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 (
|
||||
ExtensionHostService_ListExtensions_FullMethodName = "/hiddifyrpc.ExtensionHostService/ListExtensions"
|
||||
ExtensionHostService_Connect_FullMethodName = "/hiddifyrpc.ExtensionHostService/Connect"
|
||||
ExtensionHostService_EditExtension_FullMethodName = "/hiddifyrpc.ExtensionHostService/EditExtension"
|
||||
ExtensionHostService_SubmitForm_FullMethodName = "/hiddifyrpc.ExtensionHostService/SubmitForm"
|
||||
ExtensionHostService_Cancel_FullMethodName = "/hiddifyrpc.ExtensionHostService/Cancel"
|
||||
ExtensionHostService_Stop_FullMethodName = "/hiddifyrpc.ExtensionHostService/Stop"
|
||||
ExtensionHostService_GetUI_FullMethodName = "/hiddifyrpc.ExtensionHostService/GetUI"
|
||||
)
|
||||
|
||||
// ExtensionHostServiceClient is the client API for ExtensionHostService 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 ExtensionHostServiceClient interface {
|
||||
ListExtensions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ExtensionList, error)
|
||||
Connect(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ExtensionResponse], error)
|
||||
EditExtension(ctx context.Context, in *EditExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error)
|
||||
SubmitForm(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error)
|
||||
Cancel(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error)
|
||||
Stop(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error)
|
||||
GetUI(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error)
|
||||
}
|
||||
|
||||
type extensionHostServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewExtensionHostServiceClient(cc grpc.ClientConnInterface) ExtensionHostServiceClient {
|
||||
return &extensionHostServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *extensionHostServiceClient) ListExtensions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ExtensionList, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ExtensionList)
|
||||
err := c.cc.Invoke(ctx, ExtensionHostService_ListExtensions_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *extensionHostServiceClient) Connect(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ExtensionResponse], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &ExtensionHostService_ServiceDesc.Streams[0], ExtensionHostService_Connect_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[ExtensionRequest, ExtensionResponse]{ClientStream: stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type ExtensionHostService_ConnectClient = grpc.ServerStreamingClient[ExtensionResponse]
|
||||
|
||||
func (c *extensionHostServiceClient) EditExtension(ctx context.Context, in *EditExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ExtensionActionResult)
|
||||
err := c.cc.Invoke(ctx, ExtensionHostService_EditExtension_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *extensionHostServiceClient) SubmitForm(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ExtensionActionResult)
|
||||
err := c.cc.Invoke(ctx, ExtensionHostService_SubmitForm_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *extensionHostServiceClient) Cancel(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ExtensionActionResult)
|
||||
err := c.cc.Invoke(ctx, ExtensionHostService_Cancel_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *extensionHostServiceClient) Stop(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ExtensionActionResult)
|
||||
err := c.cc.Invoke(ctx, ExtensionHostService_Stop_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *extensionHostServiceClient) GetUI(ctx context.Context, in *ExtensionRequest, opts ...grpc.CallOption) (*ExtensionActionResult, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ExtensionActionResult)
|
||||
err := c.cc.Invoke(ctx, ExtensionHostService_GetUI_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ExtensionHostServiceServer is the server API for ExtensionHostService service.
|
||||
// All implementations must embed UnimplementedExtensionHostServiceServer
|
||||
// for forward compatibility.
|
||||
type ExtensionHostServiceServer interface {
|
||||
ListExtensions(context.Context, *Empty) (*ExtensionList, error)
|
||||
Connect(*ExtensionRequest, grpc.ServerStreamingServer[ExtensionResponse]) error
|
||||
EditExtension(context.Context, *EditExtensionRequest) (*ExtensionActionResult, error)
|
||||
SubmitForm(context.Context, *ExtensionRequest) (*ExtensionActionResult, error)
|
||||
Cancel(context.Context, *ExtensionRequest) (*ExtensionActionResult, error)
|
||||
Stop(context.Context, *ExtensionRequest) (*ExtensionActionResult, error)
|
||||
GetUI(context.Context, *ExtensionRequest) (*ExtensionActionResult, error)
|
||||
mustEmbedUnimplementedExtensionHostServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedExtensionHostServiceServer 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 UnimplementedExtensionHostServiceServer struct{}
|
||||
|
||||
func (UnimplementedExtensionHostServiceServer) ListExtensions(context.Context, *Empty) (*ExtensionList, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListExtensions not implemented")
|
||||
}
|
||||
func (UnimplementedExtensionHostServiceServer) Connect(*ExtensionRequest, grpc.ServerStreamingServer[ExtensionResponse]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Connect not implemented")
|
||||
}
|
||||
func (UnimplementedExtensionHostServiceServer) EditExtension(context.Context, *EditExtensionRequest) (*ExtensionActionResult, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method EditExtension not implemented")
|
||||
}
|
||||
func (UnimplementedExtensionHostServiceServer) SubmitForm(context.Context, *ExtensionRequest) (*ExtensionActionResult, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SubmitForm not implemented")
|
||||
}
|
||||
func (UnimplementedExtensionHostServiceServer) Cancel(context.Context, *ExtensionRequest) (*ExtensionActionResult, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Cancel not implemented")
|
||||
}
|
||||
func (UnimplementedExtensionHostServiceServer) Stop(context.Context, *ExtensionRequest) (*ExtensionActionResult, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented")
|
||||
}
|
||||
func (UnimplementedExtensionHostServiceServer) GetUI(context.Context, *ExtensionRequest) (*ExtensionActionResult, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetUI not implemented")
|
||||
}
|
||||
func (UnimplementedExtensionHostServiceServer) mustEmbedUnimplementedExtensionHostServiceServer() {}
|
||||
func (UnimplementedExtensionHostServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeExtensionHostServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ExtensionHostServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeExtensionHostServiceServer interface {
|
||||
mustEmbedUnimplementedExtensionHostServiceServer()
|
||||
}
|
||||
|
||||
func RegisterExtensionHostServiceServer(s grpc.ServiceRegistrar, srv ExtensionHostServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedExtensionHostServiceServer 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(&ExtensionHostService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ExtensionHostService_ListExtensions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExtensionHostServiceServer).ListExtensions(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExtensionHostService_ListExtensions_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExtensionHostServiceServer).ListExtensions(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ExtensionHostService_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(ExtensionRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(ExtensionHostServiceServer).Connect(m, &grpc.GenericServerStream[ExtensionRequest, ExtensionResponse]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type ExtensionHostService_ConnectServer = grpc.ServerStreamingServer[ExtensionResponse]
|
||||
|
||||
func _ExtensionHostService_EditExtension_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EditExtensionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExtensionHostServiceServer).EditExtension(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExtensionHostService_EditExtension_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExtensionHostServiceServer).EditExtension(ctx, req.(*EditExtensionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ExtensionHostService_SubmitForm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ExtensionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExtensionHostServiceServer).SubmitForm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExtensionHostService_SubmitForm_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExtensionHostServiceServer).SubmitForm(ctx, req.(*ExtensionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ExtensionHostService_Cancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ExtensionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExtensionHostServiceServer).Cancel(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExtensionHostService_Cancel_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExtensionHostServiceServer).Cancel(ctx, req.(*ExtensionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ExtensionHostService_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ExtensionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExtensionHostServiceServer).Stop(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExtensionHostService_Stop_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExtensionHostServiceServer).Stop(ctx, req.(*ExtensionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ExtensionHostService_GetUI_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ExtensionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ExtensionHostServiceServer).GetUI(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ExtensionHostService_GetUI_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ExtensionHostServiceServer).GetUI(ctx, req.(*ExtensionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ExtensionHostService_ServiceDesc is the grpc.ServiceDesc for ExtensionHostService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ExtensionHostService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "hiddifyrpc.ExtensionHostService",
|
||||
HandlerType: (*ExtensionHostServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListExtensions",
|
||||
Handler: _ExtensionHostService_ListExtensions_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "EditExtension",
|
||||
Handler: _ExtensionHostService_EditExtension_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SubmitForm",
|
||||
Handler: _ExtensionHostService_SubmitForm_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Cancel",
|
||||
Handler: _ExtensionHostService_Cancel_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Stop",
|
||||
Handler: _ExtensionHostService_Stop_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUI",
|
||||
Handler: _ExtensionHostService_GetUI_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Connect",
|
||||
Handler: _ExtensionHostService_Connect_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "extension.proto",
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,9 @@
|
||||
syntax = "proto3";
|
||||
|
||||
import "base.proto";
|
||||
package hiddifyrpc;
|
||||
|
||||
option go_package = "./hiddifyrpc";
|
||||
|
||||
enum ResponseCode {
|
||||
OK = 0;
|
||||
FAILED = 1;
|
||||
}
|
||||
|
||||
enum CoreState {
|
||||
STOPPED = 0;
|
||||
@@ -60,17 +56,6 @@ message Response {
|
||||
}
|
||||
|
||||
|
||||
message HelloRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message HelloResponse {
|
||||
string message = 1;
|
||||
}
|
||||
|
||||
message Empty {
|
||||
}
|
||||
|
||||
message SystemInfo {
|
||||
int64 memory = 1;
|
||||
int32 goroutines = 2;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v3.6.1
|
||||
// source: hiddifyrpc/hiddify.proto
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v5.28.0
|
||||
// source: hiddify.proto
|
||||
|
||||
package hiddifyrpc
|
||||
|
||||
@@ -15,8 +15,8 @@ import (
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Hello_SayHello_FullMethodName = "/hiddifyrpc.Hello/SayHello"
|
||||
@@ -28,7 +28,7 @@ const (
|
||||
// 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 HelloClient interface {
|
||||
SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
|
||||
SayHelloStream(ctx context.Context, opts ...grpc.CallOption) (Hello_SayHelloStreamClient, error)
|
||||
SayHelloStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[HelloRequest, HelloResponse], error)
|
||||
}
|
||||
|
||||
type helloClient struct {
|
||||
@@ -40,65 +40,52 @@ func NewHelloClient(cc grpc.ClientConnInterface) HelloClient {
|
||||
}
|
||||
|
||||
func (c *helloClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(HelloResponse)
|
||||
err := c.cc.Invoke(ctx, Hello_SayHello_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Hello_SayHello_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *helloClient) SayHelloStream(ctx context.Context, opts ...grpc.CallOption) (Hello_SayHelloStreamClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Hello_ServiceDesc.Streams[0], Hello_SayHelloStream_FullMethodName, opts...)
|
||||
func (c *helloClient) SayHelloStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[HelloRequest, HelloResponse], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &Hello_ServiceDesc.Streams[0], Hello_SayHelloStream_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &helloSayHelloStreamClient{stream}
|
||||
x := &grpc.GenericClientStream[HelloRequest, HelloResponse]{ClientStream: stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Hello_SayHelloStreamClient interface {
|
||||
Send(*HelloRequest) error
|
||||
Recv() (*HelloResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type helloSayHelloStreamClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *helloSayHelloStreamClient) Send(m *HelloRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *helloSayHelloStreamClient) Recv() (*HelloResponse, error) {
|
||||
m := new(HelloResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Hello_SayHelloStreamClient = grpc.BidiStreamingClient[HelloRequest, HelloResponse]
|
||||
|
||||
// HelloServer is the server API for Hello service.
|
||||
// All implementations must embed UnimplementedHelloServer
|
||||
// for forward compatibility
|
||||
// for forward compatibility.
|
||||
type HelloServer interface {
|
||||
SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
|
||||
SayHelloStream(Hello_SayHelloStreamServer) error
|
||||
SayHelloStream(grpc.BidiStreamingServer[HelloRequest, HelloResponse]) error
|
||||
mustEmbedUnimplementedHelloServer()
|
||||
}
|
||||
|
||||
// UnimplementedHelloServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedHelloServer struct {
|
||||
}
|
||||
// UnimplementedHelloServer 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 UnimplementedHelloServer struct{}
|
||||
|
||||
func (UnimplementedHelloServer) SayHello(context.Context, *HelloRequest) (*HelloResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
|
||||
}
|
||||
func (UnimplementedHelloServer) SayHelloStream(Hello_SayHelloStreamServer) error {
|
||||
func (UnimplementedHelloServer) SayHelloStream(grpc.BidiStreamingServer[HelloRequest, HelloResponse]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method SayHelloStream not implemented")
|
||||
}
|
||||
func (UnimplementedHelloServer) mustEmbedUnimplementedHelloServer() {}
|
||||
func (UnimplementedHelloServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeHelloServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to HelloServer will
|
||||
@@ -108,6 +95,13 @@ type UnsafeHelloServer interface {
|
||||
}
|
||||
|
||||
func RegisterHelloServer(s grpc.ServiceRegistrar, srv HelloServer) {
|
||||
// If the following call pancis, it indicates UnimplementedHelloServer 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(&Hello_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
@@ -130,30 +124,11 @@ func _Hello_SayHello_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
}
|
||||
|
||||
func _Hello_SayHelloStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(HelloServer).SayHelloStream(&helloSayHelloStreamServer{stream})
|
||||
return srv.(HelloServer).SayHelloStream(&grpc.GenericServerStream[HelloRequest, HelloResponse]{ServerStream: stream})
|
||||
}
|
||||
|
||||
type Hello_SayHelloStreamServer interface {
|
||||
Send(*HelloResponse) error
|
||||
Recv() (*HelloRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type helloSayHelloStreamServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *helloSayHelloStreamServer) Send(m *HelloResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *helloSayHelloStreamServer) Recv() (*HelloRequest, error) {
|
||||
m := new(HelloRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Hello_SayHelloStreamServer = grpc.BidiStreamingServer[HelloRequest, HelloResponse]
|
||||
|
||||
// Hello_ServiceDesc is the grpc.ServiceDesc for Hello service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
@@ -175,7 +150,7 @@ var Hello_ServiceDesc = grpc.ServiceDesc{
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "hiddifyrpc/hiddify.proto",
|
||||
Metadata: "hiddify.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -203,10 +178,10 @@ const (
|
||||
// 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 CoreClient interface {
|
||||
Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error)
|
||||
CoreInfoListener(ctx context.Context, opts ...grpc.CallOption) (Core_CoreInfoListenerClient, error)
|
||||
OutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (Core_OutboundsInfoClient, error)
|
||||
MainOutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (Core_MainOutboundsInfoClient, error)
|
||||
GetSystemInfo(ctx context.Context, opts ...grpc.CallOption) (Core_GetSystemInfoClient, error)
|
||||
CoreInfoListener(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, CoreInfoResponse], error)
|
||||
OutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, OutboundGroupList], error)
|
||||
MainOutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, OutboundGroupList], error)
|
||||
GetSystemInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, SystemInfo], error)
|
||||
Setup(ctx context.Context, in *SetupRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error)
|
||||
ChangeConfigOptions(ctx context.Context, in *ChangeConfigOptionsRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error)
|
||||
@@ -219,7 +194,7 @@ type CoreClient interface {
|
||||
GenerateWarpConfig(ctx context.Context, in *GenerateWarpConfigRequest, opts ...grpc.CallOption) (*WarpGenerationResponse, error)
|
||||
GetSystemProxyStatus(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SystemProxyStatus, error)
|
||||
SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
LogListener(ctx context.Context, opts ...grpc.CallOption) (Core_LogListenerClient, error)
|
||||
LogListener(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, LogMessage], error)
|
||||
}
|
||||
|
||||
type coreClient struct {
|
||||
@@ -231,141 +206,71 @@ func NewCoreClient(cc grpc.ClientConnInterface) CoreClient {
|
||||
}
|
||||
|
||||
func (c *coreClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CoreInfoResponse)
|
||||
err := c.cc.Invoke(ctx, Core_Start_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_Start_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *coreClient) CoreInfoListener(ctx context.Context, opts ...grpc.CallOption) (Core_CoreInfoListenerClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[0], Core_CoreInfoListener_FullMethodName, opts...)
|
||||
func (c *coreClient) CoreInfoListener(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, CoreInfoResponse], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[0], Core_CoreInfoListener_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &coreCoreInfoListenerClient{stream}
|
||||
x := &grpc.GenericClientStream[StopRequest, CoreInfoResponse]{ClientStream: stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Core_CoreInfoListenerClient interface {
|
||||
Send(*StopRequest) error
|
||||
Recv() (*CoreInfoResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Core_CoreInfoListenerClient = grpc.BidiStreamingClient[StopRequest, CoreInfoResponse]
|
||||
|
||||
type coreCoreInfoListenerClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *coreCoreInfoListenerClient) Send(m *StopRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *coreCoreInfoListenerClient) Recv() (*CoreInfoResponse, error) {
|
||||
m := new(CoreInfoResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *coreClient) OutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (Core_OutboundsInfoClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[1], Core_OutboundsInfo_FullMethodName, opts...)
|
||||
func (c *coreClient) OutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, OutboundGroupList], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[1], Core_OutboundsInfo_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &coreOutboundsInfoClient{stream}
|
||||
x := &grpc.GenericClientStream[StopRequest, OutboundGroupList]{ClientStream: stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Core_OutboundsInfoClient interface {
|
||||
Send(*StopRequest) error
|
||||
Recv() (*OutboundGroupList, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Core_OutboundsInfoClient = grpc.BidiStreamingClient[StopRequest, OutboundGroupList]
|
||||
|
||||
type coreOutboundsInfoClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *coreOutboundsInfoClient) Send(m *StopRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *coreOutboundsInfoClient) Recv() (*OutboundGroupList, error) {
|
||||
m := new(OutboundGroupList)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *coreClient) MainOutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (Core_MainOutboundsInfoClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[2], Core_MainOutboundsInfo_FullMethodName, opts...)
|
||||
func (c *coreClient) MainOutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, OutboundGroupList], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[2], Core_MainOutboundsInfo_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &coreMainOutboundsInfoClient{stream}
|
||||
x := &grpc.GenericClientStream[StopRequest, OutboundGroupList]{ClientStream: stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Core_MainOutboundsInfoClient interface {
|
||||
Send(*StopRequest) error
|
||||
Recv() (*OutboundGroupList, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Core_MainOutboundsInfoClient = grpc.BidiStreamingClient[StopRequest, OutboundGroupList]
|
||||
|
||||
type coreMainOutboundsInfoClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *coreMainOutboundsInfoClient) Send(m *StopRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *coreMainOutboundsInfoClient) Recv() (*OutboundGroupList, error) {
|
||||
m := new(OutboundGroupList)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *coreClient) GetSystemInfo(ctx context.Context, opts ...grpc.CallOption) (Core_GetSystemInfoClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[3], Core_GetSystemInfo_FullMethodName, opts...)
|
||||
func (c *coreClient) GetSystemInfo(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, SystemInfo], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[3], Core_GetSystemInfo_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &coreGetSystemInfoClient{stream}
|
||||
x := &grpc.GenericClientStream[StopRequest, SystemInfo]{ClientStream: stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Core_GetSystemInfoClient interface {
|
||||
Send(*StopRequest) error
|
||||
Recv() (*SystemInfo, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type coreGetSystemInfoClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *coreGetSystemInfoClient) Send(m *StopRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *coreGetSystemInfoClient) Recv() (*SystemInfo, error) {
|
||||
m := new(SystemInfo)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Core_GetSystemInfoClient = grpc.BidiStreamingClient[StopRequest, SystemInfo]
|
||||
|
||||
func (c *coreClient) Setup(ctx context.Context, in *SetupRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Core_Setup_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_Setup_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -373,8 +278,9 @@ func (c *coreClient) Setup(ctx context.Context, in *SetupRequest, opts ...grpc.C
|
||||
}
|
||||
|
||||
func (c *coreClient) Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ParseResponse)
|
||||
err := c.cc.Invoke(ctx, Core_Parse_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_Parse_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -382,8 +288,9 @@ func (c *coreClient) Parse(ctx context.Context, in *ParseRequest, opts ...grpc.C
|
||||
}
|
||||
|
||||
func (c *coreClient) ChangeConfigOptions(ctx context.Context, in *ChangeConfigOptionsRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CoreInfoResponse)
|
||||
err := c.cc.Invoke(ctx, Core_ChangeConfigOptions_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_ChangeConfigOptions_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -391,8 +298,9 @@ func (c *coreClient) ChangeConfigOptions(ctx context.Context, in *ChangeConfigOp
|
||||
}
|
||||
|
||||
func (c *coreClient) StartService(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CoreInfoResponse)
|
||||
err := c.cc.Invoke(ctx, Core_StartService_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_StartService_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -400,8 +308,9 @@ func (c *coreClient) StartService(ctx context.Context, in *StartRequest, opts ..
|
||||
}
|
||||
|
||||
func (c *coreClient) Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CoreInfoResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CoreInfoResponse)
|
||||
err := c.cc.Invoke(ctx, Core_Stop_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_Stop_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -409,8 +318,9 @@ func (c *coreClient) Stop(ctx context.Context, in *Empty, opts ...grpc.CallOptio
|
||||
}
|
||||
|
||||
func (c *coreClient) Restart(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CoreInfoResponse)
|
||||
err := c.cc.Invoke(ctx, Core_Restart_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_Restart_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -418,8 +328,9 @@ func (c *coreClient) Restart(ctx context.Context, in *StartRequest, opts ...grpc
|
||||
}
|
||||
|
||||
func (c *coreClient) SelectOutbound(ctx context.Context, in *SelectOutboundRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Core_SelectOutbound_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_SelectOutbound_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -427,8 +338,9 @@ func (c *coreClient) SelectOutbound(ctx context.Context, in *SelectOutboundReque
|
||||
}
|
||||
|
||||
func (c *coreClient) UrlTest(ctx context.Context, in *UrlTestRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Core_UrlTest_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_UrlTest_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -436,8 +348,9 @@ func (c *coreClient) UrlTest(ctx context.Context, in *UrlTestRequest, opts ...gr
|
||||
}
|
||||
|
||||
func (c *coreClient) GenerateWarpConfig(ctx context.Context, in *GenerateWarpConfigRequest, opts ...grpc.CallOption) (*WarpGenerationResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(WarpGenerationResponse)
|
||||
err := c.cc.Invoke(ctx, Core_GenerateWarpConfig_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_GenerateWarpConfig_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -445,8 +358,9 @@ func (c *coreClient) GenerateWarpConfig(ctx context.Context, in *GenerateWarpCon
|
||||
}
|
||||
|
||||
func (c *coreClient) GetSystemProxyStatus(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SystemProxyStatus, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SystemProxyStatus)
|
||||
err := c.cc.Invoke(ctx, Core_GetSystemProxyStatus_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_GetSystemProxyStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -454,54 +368,37 @@ func (c *coreClient) GetSystemProxyStatus(ctx context.Context, in *Empty, opts .
|
||||
}
|
||||
|
||||
func (c *coreClient) SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Core_SetSystemProxyEnabled_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, Core_SetSystemProxyEnabled_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *coreClient) LogListener(ctx context.Context, opts ...grpc.CallOption) (Core_LogListenerClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[4], Core_LogListener_FullMethodName, opts...)
|
||||
func (c *coreClient) LogListener(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StopRequest, LogMessage], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &Core_ServiceDesc.Streams[4], Core_LogListener_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &coreLogListenerClient{stream}
|
||||
x := &grpc.GenericClientStream[StopRequest, LogMessage]{ClientStream: stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Core_LogListenerClient interface {
|
||||
Send(*StopRequest) error
|
||||
Recv() (*LogMessage, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type coreLogListenerClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *coreLogListenerClient) Send(m *StopRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *coreLogListenerClient) Recv() (*LogMessage, error) {
|
||||
m := new(LogMessage)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Core_LogListenerClient = grpc.BidiStreamingClient[StopRequest, LogMessage]
|
||||
|
||||
// CoreServer is the server API for Core service.
|
||||
// All implementations must embed UnimplementedCoreServer
|
||||
// for forward compatibility
|
||||
// for forward compatibility.
|
||||
type CoreServer interface {
|
||||
Start(context.Context, *StartRequest) (*CoreInfoResponse, error)
|
||||
CoreInfoListener(Core_CoreInfoListenerServer) error
|
||||
OutboundsInfo(Core_OutboundsInfoServer) error
|
||||
MainOutboundsInfo(Core_MainOutboundsInfoServer) error
|
||||
GetSystemInfo(Core_GetSystemInfoServer) error
|
||||
CoreInfoListener(grpc.BidiStreamingServer[StopRequest, CoreInfoResponse]) error
|
||||
OutboundsInfo(grpc.BidiStreamingServer[StopRequest, OutboundGroupList]) error
|
||||
MainOutboundsInfo(grpc.BidiStreamingServer[StopRequest, OutboundGroupList]) error
|
||||
GetSystemInfo(grpc.BidiStreamingServer[StopRequest, SystemInfo]) error
|
||||
Setup(context.Context, *SetupRequest) (*Response, error)
|
||||
Parse(context.Context, *ParseRequest) (*ParseResponse, error)
|
||||
ChangeConfigOptions(context.Context, *ChangeConfigOptionsRequest) (*CoreInfoResponse, error)
|
||||
@@ -514,27 +411,30 @@ type CoreServer interface {
|
||||
GenerateWarpConfig(context.Context, *GenerateWarpConfigRequest) (*WarpGenerationResponse, error)
|
||||
GetSystemProxyStatus(context.Context, *Empty) (*SystemProxyStatus, error)
|
||||
SetSystemProxyEnabled(context.Context, *SetSystemProxyEnabledRequest) (*Response, error)
|
||||
LogListener(Core_LogListenerServer) error
|
||||
LogListener(grpc.BidiStreamingServer[StopRequest, LogMessage]) error
|
||||
mustEmbedUnimplementedCoreServer()
|
||||
}
|
||||
|
||||
// UnimplementedCoreServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedCoreServer struct {
|
||||
}
|
||||
// UnimplementedCoreServer 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 UnimplementedCoreServer struct{}
|
||||
|
||||
func (UnimplementedCoreServer) Start(context.Context, *StartRequest) (*CoreInfoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Start not implemented")
|
||||
}
|
||||
func (UnimplementedCoreServer) CoreInfoListener(Core_CoreInfoListenerServer) error {
|
||||
func (UnimplementedCoreServer) CoreInfoListener(grpc.BidiStreamingServer[StopRequest, CoreInfoResponse]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method CoreInfoListener not implemented")
|
||||
}
|
||||
func (UnimplementedCoreServer) OutboundsInfo(Core_OutboundsInfoServer) error {
|
||||
func (UnimplementedCoreServer) OutboundsInfo(grpc.BidiStreamingServer[StopRequest, OutboundGroupList]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method OutboundsInfo not implemented")
|
||||
}
|
||||
func (UnimplementedCoreServer) MainOutboundsInfo(Core_MainOutboundsInfoServer) error {
|
||||
func (UnimplementedCoreServer) MainOutboundsInfo(grpc.BidiStreamingServer[StopRequest, OutboundGroupList]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method MainOutboundsInfo not implemented")
|
||||
}
|
||||
func (UnimplementedCoreServer) GetSystemInfo(Core_GetSystemInfoServer) error {
|
||||
func (UnimplementedCoreServer) GetSystemInfo(grpc.BidiStreamingServer[StopRequest, SystemInfo]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method GetSystemInfo not implemented")
|
||||
}
|
||||
func (UnimplementedCoreServer) Setup(context.Context, *SetupRequest) (*Response, error) {
|
||||
@@ -570,10 +470,11 @@ func (UnimplementedCoreServer) GetSystemProxyStatus(context.Context, *Empty) (*S
|
||||
func (UnimplementedCoreServer) SetSystemProxyEnabled(context.Context, *SetSystemProxyEnabledRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetSystemProxyEnabled not implemented")
|
||||
}
|
||||
func (UnimplementedCoreServer) LogListener(Core_LogListenerServer) error {
|
||||
func (UnimplementedCoreServer) LogListener(grpc.BidiStreamingServer[StopRequest, LogMessage]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method LogListener not implemented")
|
||||
}
|
||||
func (UnimplementedCoreServer) mustEmbedUnimplementedCoreServer() {}
|
||||
func (UnimplementedCoreServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeCoreServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to CoreServer will
|
||||
@@ -583,6 +484,13 @@ type UnsafeCoreServer interface {
|
||||
}
|
||||
|
||||
func RegisterCoreServer(s grpc.ServiceRegistrar, srv CoreServer) {
|
||||
// If the following call pancis, it indicates UnimplementedCoreServer 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(&Core_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
@@ -605,108 +513,32 @@ func _Core_Start_Handler(srv interface{}, ctx context.Context, dec func(interfac
|
||||
}
|
||||
|
||||
func _Core_CoreInfoListener_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(CoreServer).CoreInfoListener(&coreCoreInfoListenerServer{stream})
|
||||
return srv.(CoreServer).CoreInfoListener(&grpc.GenericServerStream[StopRequest, CoreInfoResponse]{ServerStream: stream})
|
||||
}
|
||||
|
||||
type Core_CoreInfoListenerServer interface {
|
||||
Send(*CoreInfoResponse) error
|
||||
Recv() (*StopRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type coreCoreInfoListenerServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *coreCoreInfoListenerServer) Send(m *CoreInfoResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *coreCoreInfoListenerServer) Recv() (*StopRequest, error) {
|
||||
m := new(StopRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Core_CoreInfoListenerServer = grpc.BidiStreamingServer[StopRequest, CoreInfoResponse]
|
||||
|
||||
func _Core_OutboundsInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(CoreServer).OutboundsInfo(&coreOutboundsInfoServer{stream})
|
||||
return srv.(CoreServer).OutboundsInfo(&grpc.GenericServerStream[StopRequest, OutboundGroupList]{ServerStream: stream})
|
||||
}
|
||||
|
||||
type Core_OutboundsInfoServer interface {
|
||||
Send(*OutboundGroupList) error
|
||||
Recv() (*StopRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type coreOutboundsInfoServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *coreOutboundsInfoServer) Send(m *OutboundGroupList) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *coreOutboundsInfoServer) Recv() (*StopRequest, error) {
|
||||
m := new(StopRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Core_OutboundsInfoServer = grpc.BidiStreamingServer[StopRequest, OutboundGroupList]
|
||||
|
||||
func _Core_MainOutboundsInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(CoreServer).MainOutboundsInfo(&coreMainOutboundsInfoServer{stream})
|
||||
return srv.(CoreServer).MainOutboundsInfo(&grpc.GenericServerStream[StopRequest, OutboundGroupList]{ServerStream: stream})
|
||||
}
|
||||
|
||||
type Core_MainOutboundsInfoServer interface {
|
||||
Send(*OutboundGroupList) error
|
||||
Recv() (*StopRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type coreMainOutboundsInfoServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *coreMainOutboundsInfoServer) Send(m *OutboundGroupList) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *coreMainOutboundsInfoServer) Recv() (*StopRequest, error) {
|
||||
m := new(StopRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Core_MainOutboundsInfoServer = grpc.BidiStreamingServer[StopRequest, OutboundGroupList]
|
||||
|
||||
func _Core_GetSystemInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(CoreServer).GetSystemInfo(&coreGetSystemInfoServer{stream})
|
||||
return srv.(CoreServer).GetSystemInfo(&grpc.GenericServerStream[StopRequest, SystemInfo]{ServerStream: stream})
|
||||
}
|
||||
|
||||
type Core_GetSystemInfoServer interface {
|
||||
Send(*SystemInfo) error
|
||||
Recv() (*StopRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type coreGetSystemInfoServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *coreGetSystemInfoServer) Send(m *SystemInfo) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *coreGetSystemInfoServer) Recv() (*StopRequest, error) {
|
||||
m := new(StopRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Core_GetSystemInfoServer = grpc.BidiStreamingServer[StopRequest, SystemInfo]
|
||||
|
||||
func _Core_Setup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetupRequest)
|
||||
@@ -907,30 +739,11 @@ func _Core_SetSystemProxyEnabled_Handler(srv interface{}, ctx context.Context, d
|
||||
}
|
||||
|
||||
func _Core_LogListener_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(CoreServer).LogListener(&coreLogListenerServer{stream})
|
||||
return srv.(CoreServer).LogListener(&grpc.GenericServerStream[StopRequest, LogMessage]{ServerStream: stream})
|
||||
}
|
||||
|
||||
type Core_LogListenerServer interface {
|
||||
Send(*LogMessage) error
|
||||
Recv() (*StopRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type coreLogListenerServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *coreLogListenerServer) Send(m *LogMessage) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *coreLogListenerServer) Recv() (*StopRequest, error) {
|
||||
m := new(StopRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type Core_LogListenerServer = grpc.BidiStreamingServer[StopRequest, LogMessage]
|
||||
|
||||
// Core_ServiceDesc is the grpc.ServiceDesc for Core service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
@@ -1020,7 +833,7 @@ var Core_ServiceDesc = grpc.ServiceDesc{
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "hiddifyrpc/hiddify.proto",
|
||||
Metadata: "hiddify.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -1049,8 +862,9 @@ func NewTunnelServiceClient(cc grpc.ClientConnInterface) TunnelServiceClient {
|
||||
}
|
||||
|
||||
func (c *tunnelServiceClient) Start(ctx context.Context, in *TunnelStartRequest, opts ...grpc.CallOption) (*TunnelResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(TunnelResponse)
|
||||
err := c.cc.Invoke(ctx, TunnelService_Start_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TunnelService_Start_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1058,8 +872,9 @@ func (c *tunnelServiceClient) Start(ctx context.Context, in *TunnelStartRequest,
|
||||
}
|
||||
|
||||
func (c *tunnelServiceClient) Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TunnelResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(TunnelResponse)
|
||||
err := c.cc.Invoke(ctx, TunnelService_Stop_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TunnelService_Stop_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1067,8 +882,9 @@ func (c *tunnelServiceClient) Stop(ctx context.Context, in *Empty, opts ...grpc.
|
||||
}
|
||||
|
||||
func (c *tunnelServiceClient) Status(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TunnelResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(TunnelResponse)
|
||||
err := c.cc.Invoke(ctx, TunnelService_Status_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TunnelService_Status_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1076,8 +892,9 @@ func (c *tunnelServiceClient) Status(ctx context.Context, in *Empty, opts ...grp
|
||||
}
|
||||
|
||||
func (c *tunnelServiceClient) Exit(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*TunnelResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(TunnelResponse)
|
||||
err := c.cc.Invoke(ctx, TunnelService_Exit_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TunnelService_Exit_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -1086,7 +903,7 @@ func (c *tunnelServiceClient) Exit(ctx context.Context, in *Empty, opts ...grpc.
|
||||
|
||||
// TunnelServiceServer is the server API for TunnelService service.
|
||||
// All implementations must embed UnimplementedTunnelServiceServer
|
||||
// for forward compatibility
|
||||
// for forward compatibility.
|
||||
type TunnelServiceServer interface {
|
||||
Start(context.Context, *TunnelStartRequest) (*TunnelResponse, error)
|
||||
Stop(context.Context, *Empty) (*TunnelResponse, error)
|
||||
@@ -1095,9 +912,12 @@ type TunnelServiceServer interface {
|
||||
mustEmbedUnimplementedTunnelServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedTunnelServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedTunnelServiceServer struct {
|
||||
}
|
||||
// UnimplementedTunnelServiceServer 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 UnimplementedTunnelServiceServer struct{}
|
||||
|
||||
func (UnimplementedTunnelServiceServer) Start(context.Context, *TunnelStartRequest) (*TunnelResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Start not implemented")
|
||||
@@ -1112,6 +932,7 @@ func (UnimplementedTunnelServiceServer) Exit(context.Context, *Empty) (*TunnelRe
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Exit not implemented")
|
||||
}
|
||||
func (UnimplementedTunnelServiceServer) mustEmbedUnimplementedTunnelServiceServer() {}
|
||||
func (UnimplementedTunnelServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeTunnelServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to TunnelServiceServer will
|
||||
@@ -1121,6 +942,13 @@ type UnsafeTunnelServiceServer interface {
|
||||
}
|
||||
|
||||
func RegisterTunnelServiceServer(s grpc.ServiceRegistrar, srv TunnelServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedTunnelServiceServer 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(&TunnelService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
@@ -1221,5 +1049,5 @@ var TunnelService_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "hiddifyrpc/hiddify.proto",
|
||||
Metadata: "hiddify.proto",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user