new: Extensions v0
This commit is contained in:
@@ -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