new: add hiddifyrpc
This commit is contained in:
1662
hiddifyrpc/hiddify.pb.go
Normal file
1662
hiddifyrpc/hiddify.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
214
hiddifyrpc/hiddify.proto
Normal file
214
hiddifyrpc/hiddify.proto
Normal file
@@ -0,0 +1,214 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package hiddifyrpc;
|
||||
|
||||
option go_package = "./hiddifyrpc";
|
||||
|
||||
enum ResponseCode {
|
||||
OK = 0;
|
||||
FAILED = 1;
|
||||
}
|
||||
|
||||
enum CoreState {
|
||||
STOPPED = 0;
|
||||
STARTING = 1;
|
||||
STARTED = 2;
|
||||
STOPPING = 3;
|
||||
}
|
||||
|
||||
enum MessageType {
|
||||
EMPTY=0;
|
||||
EMPTY_CONFIGURATION = 1;
|
||||
START_COMMAND_SERVER = 2;
|
||||
CREATE_SERVICE = 3;
|
||||
START_SERVICE = 4;
|
||||
UNEXPECTED_ERROR = 5;
|
||||
ALREADY_STARTED = 6;
|
||||
ALREADY_STOPPED = 7;
|
||||
INSTANCE_NOT_FOUND = 8;
|
||||
INSTANCE_NOT_STOPPED = 9;
|
||||
INSTANCE_NOT_STARTED = 10;
|
||||
ERROR_BUILDING_CONFIG = 11;
|
||||
ERROR_PARSING_CONFIG = 12;
|
||||
ERROR_READING_CONFIG = 13;
|
||||
}
|
||||
|
||||
message CoreInfoResponse {
|
||||
CoreState core_state = 1;
|
||||
MessageType message_type = 2;
|
||||
string message = 3;
|
||||
}
|
||||
|
||||
message StartRequest {
|
||||
string config_path = 1;
|
||||
string config_content = 2; // Optional if configPath is not provided.
|
||||
bool disable_memory_limit = 3;
|
||||
bool delay_start = 4;
|
||||
}
|
||||
|
||||
message SetupRequest {
|
||||
string base_path = 1;
|
||||
string working_path = 2;
|
||||
string temp_path = 3;
|
||||
}
|
||||
|
||||
message Response {
|
||||
ResponseCode response_code = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
|
||||
message HelloRequest {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message HelloResponse {
|
||||
string message = 1;
|
||||
}
|
||||
|
||||
message Empty {
|
||||
}
|
||||
|
||||
message SystemInfo {
|
||||
int64 memory = 1;
|
||||
int32 goroutines = 2;
|
||||
int32 connections_in = 3;
|
||||
int32 connections_out = 4;
|
||||
bool traffic_available = 5;
|
||||
int64 uplink = 6;
|
||||
int64 downlink = 7;
|
||||
int64 uplink_total = 8;
|
||||
int64 downlink_total = 9;
|
||||
}
|
||||
|
||||
message OutboundGroupItem {
|
||||
string tag = 1;
|
||||
string type = 2;
|
||||
int64 url_test_time = 3;
|
||||
int32 url_test_delay = 4;
|
||||
}
|
||||
|
||||
message OutboundGroup {
|
||||
string tag = 1;
|
||||
string type = 2;
|
||||
string selected=3;
|
||||
repeated OutboundGroupItem items = 4;
|
||||
|
||||
}
|
||||
message OutboundGroupList{
|
||||
repeated OutboundGroup items = 1;
|
||||
}
|
||||
|
||||
message WarpAccount {
|
||||
string account_id = 1;
|
||||
string access_token = 2;
|
||||
}
|
||||
|
||||
message WarpWireguardConfig {
|
||||
string private_key = 1;
|
||||
string local_address_ipv4 = 2;
|
||||
string local_address_ipv6 = 3;
|
||||
string peer_public_key = 4;
|
||||
}
|
||||
|
||||
message WarpGenerationResponse {
|
||||
WarpAccount account = 1;
|
||||
string log = 2;
|
||||
WarpWireguardConfig config = 3;
|
||||
}
|
||||
|
||||
message SystemProxyStatus {
|
||||
bool available = 1;
|
||||
bool enabled = 2;
|
||||
}
|
||||
|
||||
message ParseRequest {
|
||||
string content = 1;
|
||||
bool debug = 2;
|
||||
}
|
||||
|
||||
message ParseResponse {
|
||||
ResponseCode response_code = 1;
|
||||
string content = 2;
|
||||
string message = 3;
|
||||
}
|
||||
|
||||
message ChangeConfigOptionsRequest {
|
||||
string config_options_json = 1;
|
||||
}
|
||||
|
||||
message GenerateConfigRequest {
|
||||
string path = 1;
|
||||
string temp_path = 2;
|
||||
bool debug = 3;
|
||||
}
|
||||
|
||||
message GenerateConfigResponse {
|
||||
string config_content = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
message SelectOutboundRequest {
|
||||
string group_tag = 1;
|
||||
string outbound_tag = 2;
|
||||
}
|
||||
|
||||
message UrlTestRequest {
|
||||
string group_tag = 1;
|
||||
}
|
||||
|
||||
message GenerateWarpConfigRequest {
|
||||
string license_key = 1;
|
||||
string account_id = 2;
|
||||
string access_token = 3;
|
||||
}
|
||||
|
||||
message SetSystemProxyEnabledRequest {
|
||||
bool is_enabled = 1;
|
||||
}
|
||||
|
||||
enum LogLevel {
|
||||
DEBUG = 0;
|
||||
INFO = 1;
|
||||
WARNING = 2;
|
||||
ERROR = 3;
|
||||
FATAL = 4;
|
||||
}
|
||||
enum LogType {
|
||||
CORE = 0;
|
||||
SERVICE = 1;
|
||||
CONFIG = 2;
|
||||
}
|
||||
message LogMessage {
|
||||
LogLevel level = 1;
|
||||
LogType type = 2;
|
||||
string message = 3;
|
||||
}
|
||||
|
||||
message StopRequest{
|
||||
}
|
||||
|
||||
service Hiddify {
|
||||
rpc SayHello (HelloRequest) returns (HelloResponse);
|
||||
rpc SayHelloStream (stream HelloRequest) returns (stream HelloResponse);
|
||||
rpc Start (StartRequest) returns (CoreInfoResponse);
|
||||
rpc CoreInfoListener (stream StopRequest) returns (stream CoreInfoResponse);
|
||||
rpc OutboundsInfo (stream StopRequest) returns (stream OutboundGroupList);
|
||||
rpc MainOutboundsInfo (stream StopRequest) returns (stream OutboundGroupList);
|
||||
rpc GetSystemInfo (stream StopRequest) returns (stream SystemInfo);
|
||||
rpc Setup (SetupRequest) returns (Response);
|
||||
rpc Parse (ParseRequest) returns (ParseResponse);
|
||||
//rpc ChangeConfigOptions (ChangeConfigOptionsRequest) returns (CoreInfoResponse);
|
||||
//rpc GenerateConfig (GenerateConfigRequest) returns (GenerateConfigResponse);
|
||||
rpc StartService (StartRequest) returns (CoreInfoResponse);
|
||||
rpc Stop (Empty) returns (CoreInfoResponse);
|
||||
rpc Restart (StartRequest) returns (CoreInfoResponse);
|
||||
rpc SelectOutbound (SelectOutboundRequest) returns (Response);
|
||||
rpc UrlTest (UrlTestRequest) returns (Response);
|
||||
rpc GenerateWarpConfig (GenerateWarpConfigRequest) returns (WarpGenerationResponse);
|
||||
rpc GetSystemProxyStatus (Empty) returns (SystemProxyStatus);
|
||||
rpc SetSystemProxyEnabled (SetSystemProxyEnabledRequest) returns (Response);
|
||||
rpc LogListener (stream StopRequest) returns (stream LogMessage);
|
||||
|
||||
}
|
||||
935
hiddifyrpc/hiddify_grpc.pb.go
Normal file
935
hiddifyrpc/hiddify_grpc.pb.go
Normal file
@@ -0,0 +1,935 @@
|
||||
// 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
|
||||
|
||||
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.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Hiddify_SayHello_FullMethodName = "/hiddifyrpc.Hiddify/SayHello"
|
||||
Hiddify_SayHelloStream_FullMethodName = "/hiddifyrpc.Hiddify/SayHelloStream"
|
||||
Hiddify_Start_FullMethodName = "/hiddifyrpc.Hiddify/Start"
|
||||
Hiddify_CoreInfoListener_FullMethodName = "/hiddifyrpc.Hiddify/CoreInfoListener"
|
||||
Hiddify_OutboundsInfo_FullMethodName = "/hiddifyrpc.Hiddify/OutboundsInfo"
|
||||
Hiddify_MainOutboundsInfo_FullMethodName = "/hiddifyrpc.Hiddify/MainOutboundsInfo"
|
||||
Hiddify_GetSystemInfo_FullMethodName = "/hiddifyrpc.Hiddify/GetSystemInfo"
|
||||
Hiddify_Setup_FullMethodName = "/hiddifyrpc.Hiddify/Setup"
|
||||
Hiddify_Parse_FullMethodName = "/hiddifyrpc.Hiddify/Parse"
|
||||
Hiddify_StartService_FullMethodName = "/hiddifyrpc.Hiddify/StartService"
|
||||
Hiddify_Stop_FullMethodName = "/hiddifyrpc.Hiddify/Stop"
|
||||
Hiddify_Restart_FullMethodName = "/hiddifyrpc.Hiddify/Restart"
|
||||
Hiddify_SelectOutbound_FullMethodName = "/hiddifyrpc.Hiddify/SelectOutbound"
|
||||
Hiddify_UrlTest_FullMethodName = "/hiddifyrpc.Hiddify/UrlTest"
|
||||
Hiddify_GenerateWarpConfig_FullMethodName = "/hiddifyrpc.Hiddify/GenerateWarpConfig"
|
||||
Hiddify_GetSystemProxyStatus_FullMethodName = "/hiddifyrpc.Hiddify/GetSystemProxyStatus"
|
||||
Hiddify_SetSystemProxyEnabled_FullMethodName = "/hiddifyrpc.Hiddify/SetSystemProxyEnabled"
|
||||
Hiddify_LogListener_FullMethodName = "/hiddifyrpc.Hiddify/LogListener"
|
||||
)
|
||||
|
||||
// HiddifyClient is the client API for Hiddify 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 HiddifyClient interface {
|
||||
SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
|
||||
SayHelloStream(ctx context.Context, opts ...grpc.CallOption) (Hiddify_SayHelloStreamClient, error)
|
||||
Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error)
|
||||
CoreInfoListener(ctx context.Context, opts ...grpc.CallOption) (Hiddify_CoreInfoListenerClient, error)
|
||||
OutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (Hiddify_OutboundsInfoClient, error)
|
||||
MainOutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (Hiddify_MainOutboundsInfoClient, error)
|
||||
GetSystemInfo(ctx context.Context, opts ...grpc.CallOption) (Hiddify_GetSystemInfoClient, error)
|
||||
Setup(ctx context.Context, in *SetupRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error)
|
||||
//rpc ChangeConfigOptions (ChangeConfigOptionsRequest) returns (CoreInfoResponse);
|
||||
//rpc GenerateConfig (GenerateConfigRequest) returns (GenerateConfigResponse);
|
||||
StartService(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error)
|
||||
Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CoreInfoResponse, error)
|
||||
Restart(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error)
|
||||
SelectOutbound(ctx context.Context, in *SelectOutboundRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
UrlTest(ctx context.Context, in *UrlTestRequest, opts ...grpc.CallOption) (*Response, error)
|
||||
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) (Hiddify_LogListenerClient, error)
|
||||
}
|
||||
|
||||
type hiddifyClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewHiddifyClient(cc grpc.ClientConnInterface) HiddifyClient {
|
||||
return &hiddifyClient{cc}
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) {
|
||||
out := new(HelloResponse)
|
||||
err := c.cc.Invoke(ctx, Hiddify_SayHello_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) SayHelloStream(ctx context.Context, opts ...grpc.CallOption) (Hiddify_SayHelloStreamClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Hiddify_ServiceDesc.Streams[0], Hiddify_SayHelloStream_FullMethodName, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &hiddifySayHelloStreamClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Hiddify_SayHelloStreamClient interface {
|
||||
Send(*HelloRequest) error
|
||||
Recv() (*HelloResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type hiddifySayHelloStreamClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *hiddifySayHelloStreamClient) Send(m *HelloRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifySayHelloStreamClient) Recv() (*HelloResponse, error) {
|
||||
m := new(HelloResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) {
|
||||
out := new(CoreInfoResponse)
|
||||
err := c.cc.Invoke(ctx, Hiddify_Start_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) CoreInfoListener(ctx context.Context, opts ...grpc.CallOption) (Hiddify_CoreInfoListenerClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Hiddify_ServiceDesc.Streams[1], Hiddify_CoreInfoListener_FullMethodName, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &hiddifyCoreInfoListenerClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Hiddify_CoreInfoListenerClient interface {
|
||||
Send(*StopRequest) error
|
||||
Recv() (*CoreInfoResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type hiddifyCoreInfoListenerClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *hiddifyCoreInfoListenerClient) Send(m *StopRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifyCoreInfoListenerClient) Recv() (*CoreInfoResponse, error) {
|
||||
m := new(CoreInfoResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) OutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (Hiddify_OutboundsInfoClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Hiddify_ServiceDesc.Streams[2], Hiddify_OutboundsInfo_FullMethodName, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &hiddifyOutboundsInfoClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Hiddify_OutboundsInfoClient interface {
|
||||
Send(*StopRequest) error
|
||||
Recv() (*OutboundGroupList, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type hiddifyOutboundsInfoClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *hiddifyOutboundsInfoClient) Send(m *StopRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifyOutboundsInfoClient) Recv() (*OutboundGroupList, error) {
|
||||
m := new(OutboundGroupList)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) MainOutboundsInfo(ctx context.Context, opts ...grpc.CallOption) (Hiddify_MainOutboundsInfoClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Hiddify_ServiceDesc.Streams[3], Hiddify_MainOutboundsInfo_FullMethodName, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &hiddifyMainOutboundsInfoClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Hiddify_MainOutboundsInfoClient interface {
|
||||
Send(*StopRequest) error
|
||||
Recv() (*OutboundGroupList, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type hiddifyMainOutboundsInfoClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *hiddifyMainOutboundsInfoClient) Send(m *StopRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifyMainOutboundsInfoClient) Recv() (*OutboundGroupList, error) {
|
||||
m := new(OutboundGroupList)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) GetSystemInfo(ctx context.Context, opts ...grpc.CallOption) (Hiddify_GetSystemInfoClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Hiddify_ServiceDesc.Streams[4], Hiddify_GetSystemInfo_FullMethodName, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &hiddifyGetSystemInfoClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Hiddify_GetSystemInfoClient interface {
|
||||
Send(*StopRequest) error
|
||||
Recv() (*SystemInfo, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type hiddifyGetSystemInfoClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *hiddifyGetSystemInfoClient) Send(m *StopRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifyGetSystemInfoClient) Recv() (*SystemInfo, error) {
|
||||
m := new(SystemInfo)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) Setup(ctx context.Context, in *SetupRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Hiddify_Setup_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) Parse(ctx context.Context, in *ParseRequest, opts ...grpc.CallOption) (*ParseResponse, error) {
|
||||
out := new(ParseResponse)
|
||||
err := c.cc.Invoke(ctx, Hiddify_Parse_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) StartService(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) {
|
||||
out := new(CoreInfoResponse)
|
||||
err := c.cc.Invoke(ctx, Hiddify_StartService_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CoreInfoResponse, error) {
|
||||
out := new(CoreInfoResponse)
|
||||
err := c.cc.Invoke(ctx, Hiddify_Stop_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) Restart(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*CoreInfoResponse, error) {
|
||||
out := new(CoreInfoResponse)
|
||||
err := c.cc.Invoke(ctx, Hiddify_Restart_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) SelectOutbound(ctx context.Context, in *SelectOutboundRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Hiddify_SelectOutbound_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) UrlTest(ctx context.Context, in *UrlTestRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Hiddify_UrlTest_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) GenerateWarpConfig(ctx context.Context, in *GenerateWarpConfigRequest, opts ...grpc.CallOption) (*WarpGenerationResponse, error) {
|
||||
out := new(WarpGenerationResponse)
|
||||
err := c.cc.Invoke(ctx, Hiddify_GenerateWarpConfig_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) GetSystemProxyStatus(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SystemProxyStatus, error) {
|
||||
out := new(SystemProxyStatus)
|
||||
err := c.cc.Invoke(ctx, Hiddify_GetSystemProxyStatus_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) SetSystemProxyEnabled(ctx context.Context, in *SetSystemProxyEnabledRequest, opts ...grpc.CallOption) (*Response, error) {
|
||||
out := new(Response)
|
||||
err := c.cc.Invoke(ctx, Hiddify_SetSystemProxyEnabled_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *hiddifyClient) LogListener(ctx context.Context, opts ...grpc.CallOption) (Hiddify_LogListenerClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &Hiddify_ServiceDesc.Streams[5], Hiddify_LogListener_FullMethodName, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &hiddifyLogListenerClient{stream}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type Hiddify_LogListenerClient interface {
|
||||
Send(*StopRequest) error
|
||||
Recv() (*LogMessage, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type hiddifyLogListenerClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *hiddifyLogListenerClient) Send(m *StopRequest) error {
|
||||
return x.ClientStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifyLogListenerClient) Recv() (*LogMessage, error) {
|
||||
m := new(LogMessage)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// HiddifyServer is the server API for Hiddify service.
|
||||
// All implementations must embed UnimplementedHiddifyServer
|
||||
// for forward compatibility
|
||||
type HiddifyServer interface {
|
||||
SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
|
||||
SayHelloStream(Hiddify_SayHelloStreamServer) error
|
||||
Start(context.Context, *StartRequest) (*CoreInfoResponse, error)
|
||||
CoreInfoListener(Hiddify_CoreInfoListenerServer) error
|
||||
OutboundsInfo(Hiddify_OutboundsInfoServer) error
|
||||
MainOutboundsInfo(Hiddify_MainOutboundsInfoServer) error
|
||||
GetSystemInfo(Hiddify_GetSystemInfoServer) error
|
||||
Setup(context.Context, *SetupRequest) (*Response, error)
|
||||
Parse(context.Context, *ParseRequest) (*ParseResponse, error)
|
||||
//rpc ChangeConfigOptions (ChangeConfigOptionsRequest) returns (CoreInfoResponse);
|
||||
//rpc GenerateConfig (GenerateConfigRequest) returns (GenerateConfigResponse);
|
||||
StartService(context.Context, *StartRequest) (*CoreInfoResponse, error)
|
||||
Stop(context.Context, *Empty) (*CoreInfoResponse, error)
|
||||
Restart(context.Context, *StartRequest) (*CoreInfoResponse, error)
|
||||
SelectOutbound(context.Context, *SelectOutboundRequest) (*Response, error)
|
||||
UrlTest(context.Context, *UrlTestRequest) (*Response, error)
|
||||
GenerateWarpConfig(context.Context, *GenerateWarpConfigRequest) (*WarpGenerationResponse, error)
|
||||
GetSystemProxyStatus(context.Context, *Empty) (*SystemProxyStatus, error)
|
||||
SetSystemProxyEnabled(context.Context, *SetSystemProxyEnabledRequest) (*Response, error)
|
||||
LogListener(Hiddify_LogListenerServer) error
|
||||
mustEmbedUnimplementedHiddifyServer()
|
||||
}
|
||||
|
||||
// UnimplementedHiddifyServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedHiddifyServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedHiddifyServer) SayHello(context.Context, *HelloRequest) (*HelloResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) SayHelloStream(Hiddify_SayHelloStreamServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method SayHelloStream not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) Start(context.Context, *StartRequest) (*CoreInfoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Start not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) CoreInfoListener(Hiddify_CoreInfoListenerServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method CoreInfoListener not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) OutboundsInfo(Hiddify_OutboundsInfoServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method OutboundsInfo not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) MainOutboundsInfo(Hiddify_MainOutboundsInfoServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method MainOutboundsInfo not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) GetSystemInfo(Hiddify_GetSystemInfoServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method GetSystemInfo not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) Setup(context.Context, *SetupRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Setup not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) Parse(context.Context, *ParseRequest) (*ParseResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Parse not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) StartService(context.Context, *StartRequest) (*CoreInfoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method StartService not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) Stop(context.Context, *Empty) (*CoreInfoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) Restart(context.Context, *StartRequest) (*CoreInfoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Restart not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) SelectOutbound(context.Context, *SelectOutboundRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SelectOutbound not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) UrlTest(context.Context, *UrlTestRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UrlTest not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) GenerateWarpConfig(context.Context, *GenerateWarpConfigRequest) (*WarpGenerationResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GenerateWarpConfig not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) GetSystemProxyStatus(context.Context, *Empty) (*SystemProxyStatus, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetSystemProxyStatus not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) SetSystemProxyEnabled(context.Context, *SetSystemProxyEnabledRequest) (*Response, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetSystemProxyEnabled not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) LogListener(Hiddify_LogListenerServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method LogListener not implemented")
|
||||
}
|
||||
func (UnimplementedHiddifyServer) mustEmbedUnimplementedHiddifyServer() {}
|
||||
|
||||
// UnsafeHiddifyServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to HiddifyServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeHiddifyServer interface {
|
||||
mustEmbedUnimplementedHiddifyServer()
|
||||
}
|
||||
|
||||
func RegisterHiddifyServer(s grpc.ServiceRegistrar, srv HiddifyServer) {
|
||||
s.RegisterService(&Hiddify_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Hiddify_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(HelloRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HiddifyServer).SayHello(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_SayHello_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).SayHello(ctx, req.(*HelloRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_SayHelloStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(HiddifyServer).SayHelloStream(&hiddifySayHelloStreamServer{stream})
|
||||
}
|
||||
|
||||
type Hiddify_SayHelloStreamServer interface {
|
||||
Send(*HelloResponse) error
|
||||
Recv() (*HelloRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type hiddifySayHelloStreamServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *hiddifySayHelloStreamServer) Send(m *HelloResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifySayHelloStreamServer) Recv() (*HelloRequest, error) {
|
||||
m := new(HelloRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _Hiddify_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StartRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HiddifyServer).Start(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_Start_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).Start(ctx, req.(*StartRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_CoreInfoListener_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(HiddifyServer).CoreInfoListener(&hiddifyCoreInfoListenerServer{stream})
|
||||
}
|
||||
|
||||
type Hiddify_CoreInfoListenerServer interface {
|
||||
Send(*CoreInfoResponse) error
|
||||
Recv() (*StopRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type hiddifyCoreInfoListenerServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *hiddifyCoreInfoListenerServer) Send(m *CoreInfoResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifyCoreInfoListenerServer) Recv() (*StopRequest, error) {
|
||||
m := new(StopRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _Hiddify_OutboundsInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(HiddifyServer).OutboundsInfo(&hiddifyOutboundsInfoServer{stream})
|
||||
}
|
||||
|
||||
type Hiddify_OutboundsInfoServer interface {
|
||||
Send(*OutboundGroupList) error
|
||||
Recv() (*StopRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type hiddifyOutboundsInfoServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *hiddifyOutboundsInfoServer) Send(m *OutboundGroupList) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifyOutboundsInfoServer) Recv() (*StopRequest, error) {
|
||||
m := new(StopRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _Hiddify_MainOutboundsInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(HiddifyServer).MainOutboundsInfo(&hiddifyMainOutboundsInfoServer{stream})
|
||||
}
|
||||
|
||||
type Hiddify_MainOutboundsInfoServer interface {
|
||||
Send(*OutboundGroupList) error
|
||||
Recv() (*StopRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type hiddifyMainOutboundsInfoServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *hiddifyMainOutboundsInfoServer) Send(m *OutboundGroupList) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifyMainOutboundsInfoServer) Recv() (*StopRequest, error) {
|
||||
m := new(StopRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _Hiddify_GetSystemInfo_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(HiddifyServer).GetSystemInfo(&hiddifyGetSystemInfoServer{stream})
|
||||
}
|
||||
|
||||
type Hiddify_GetSystemInfoServer interface {
|
||||
Send(*SystemInfo) error
|
||||
Recv() (*StopRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type hiddifyGetSystemInfoServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *hiddifyGetSystemInfoServer) Send(m *SystemInfo) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifyGetSystemInfoServer) Recv() (*StopRequest, error) {
|
||||
m := new(StopRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func _Hiddify_Setup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetupRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HiddifyServer).Setup(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_Setup_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).Setup(ctx, req.(*SetupRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_Parse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ParseRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HiddifyServer).Parse(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_Parse_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).Parse(ctx, req.(*ParseRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_StartService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StartRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HiddifyServer).StartService(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_StartService_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).StartService(ctx, req.(*StartRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_Stop_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.(HiddifyServer).Stop(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_Stop_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).Stop(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_Restart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(StartRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HiddifyServer).Restart(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_Restart_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).Restart(ctx, req.(*StartRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_SelectOutbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SelectOutboundRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HiddifyServer).SelectOutbound(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_SelectOutbound_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).SelectOutbound(ctx, req.(*SelectOutboundRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_UrlTest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UrlTestRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HiddifyServer).UrlTest(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_UrlTest_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).UrlTest(ctx, req.(*UrlTestRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_GenerateWarpConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GenerateWarpConfigRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HiddifyServer).GenerateWarpConfig(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_GenerateWarpConfig_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).GenerateWarpConfig(ctx, req.(*GenerateWarpConfigRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_GetSystemProxyStatus_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.(HiddifyServer).GetSystemProxyStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_GetSystemProxyStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).GetSystemProxyStatus(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_SetSystemProxyEnabled_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetSystemProxyEnabledRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HiddifyServer).SetSystemProxyEnabled(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Hiddify_SetSystemProxyEnabled_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HiddifyServer).SetSystemProxyEnabled(ctx, req.(*SetSystemProxyEnabledRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Hiddify_LogListener_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(HiddifyServer).LogListener(&hiddifyLogListenerServer{stream})
|
||||
}
|
||||
|
||||
type Hiddify_LogListenerServer interface {
|
||||
Send(*LogMessage) error
|
||||
Recv() (*StopRequest, error)
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type hiddifyLogListenerServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *hiddifyLogListenerServer) Send(m *LogMessage) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func (x *hiddifyLogListenerServer) Recv() (*StopRequest, error) {
|
||||
m := new(StopRequest)
|
||||
if err := x.ServerStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// Hiddify_ServiceDesc is the grpc.ServiceDesc for Hiddify service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Hiddify_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "hiddifyrpc.Hiddify",
|
||||
HandlerType: (*HiddifyServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "SayHello",
|
||||
Handler: _Hiddify_SayHello_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Start",
|
||||
Handler: _Hiddify_Start_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Setup",
|
||||
Handler: _Hiddify_Setup_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Parse",
|
||||
Handler: _Hiddify_Parse_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "StartService",
|
||||
Handler: _Hiddify_StartService_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Stop",
|
||||
Handler: _Hiddify_Stop_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Restart",
|
||||
Handler: _Hiddify_Restart_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SelectOutbound",
|
||||
Handler: _Hiddify_SelectOutbound_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UrlTest",
|
||||
Handler: _Hiddify_UrlTest_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GenerateWarpConfig",
|
||||
Handler: _Hiddify_GenerateWarpConfig_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetSystemProxyStatus",
|
||||
Handler: _Hiddify_GetSystemProxyStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetSystemProxyEnabled",
|
||||
Handler: _Hiddify_SetSystemProxyEnabled_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "SayHelloStream",
|
||||
Handler: _Hiddify_SayHelloStream_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "CoreInfoListener",
|
||||
Handler: _Hiddify_CoreInfoListener_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "OutboundsInfo",
|
||||
Handler: _Hiddify_OutboundsInfo_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "MainOutboundsInfo",
|
||||
Handler: _Hiddify_MainOutboundsInfo_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "GetSystemInfo",
|
||||
Handler: _Hiddify_GetSystemInfo_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "LogListener",
|
||||
Handler: _Hiddify_LogListener_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "hiddifyrpc/hiddify.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user