Documentation ¶
Index ¶
- Constants
- Variables
- func ChangeConfigOptions(in *pb.ChangeConfigOptionsRequest) (*pb.CoreInfoResponse, error)
- func GenerateConfig(in *pb.GenerateConfigRequest) (*pb.GenerateConfigResponse, error)
- func GenerateWarpConfig(in *pb.GenerateWarpConfigRequest) (*pb.WarpGenerationResponse, error)
- func GetSystemProxyStatus(ctx context.Context, empty *pb.Empty) (*pb.SystemProxyStatus, error)
- func Log(level pb.LogLevel, typ pb.LogType, message string)
- func NewObserver[T any](listenerBufferSize int) *observable.Observer[T]
- func NewService(options option.Options) (*libbox.BoxService, error)
- func Parse(in *pb.ParseRequest) (*pb.ParseResponse, error)
- func Restart(in *pb.StartRequest) (*pb.CoreInfoResponse, error)
- func RunStandalone(hiddifySettingPath string, configPath string, ...) error
- func SelectOutbound(in *pb.SelectOutboundRequest) (*pb.Response, error)
- func SetCoreStatus(state pb.CoreState, msgType pb.MessageType, message string) pb.CoreInfoResponse
- func SetSystemProxyEnabled(ctx context.Context, in *pb.SetSystemProxyEnabledRequest) (*pb.Response, error)
- func Setup(basePath string, workingPath string, tempPath string, statusPort int64, ...) error
- func Start(in *pb.StartRequest) (*pb.CoreInfoResponse, error)
- func StartCommand(command int32, port int64) error
- func StartCoreGrpcServer(listenAddressG string) error
- func StartGrpcServer(listenAddressG string, service string) error
- func StartHelloGrpcServer(listenAddressG string) error
- func StartService(in *pb.StartRequest) (*pb.CoreInfoResponse, error)
- func StartTunnelGrpcServer(listenAddressG string) error
- func StartTunnelService(goArg string) (int, string)
- func Stop() (*pb.CoreInfoResponse, error)
- func StopAndAlert(msgType pb.MessageType, message string)
- func StopCommand(command int32) error
- func UrlTest(in *pb.UrlTestRequest) (*pb.Response, error)
- type CommandClientHandler
- func (cch *CommandClientHandler) ClearLog()
- func (cch *CommandClientHandler) Connected()
- func (cch *CommandClientHandler) Disconnected(message string)
- func (cch *CommandClientHandler) InitializeClashMode(modeList libbox.StringIterator, currentMode string)
- func (cch *CommandClientHandler) UpdateClashMode(newMode string)
- func (cch *CommandClientHandler) WriteGroups(message libbox.OutboundGroupIterator)
- func (cch *CommandClientHandler) WriteLog(message string)
- func (cch *CommandClientHandler) WriteStatus(message *libbox.StatusMessage)
- type CommandServerHandler
- type ConfigResult
- type CoreService
- func (s *CoreService) ChangeConfigOptions(ctx context.Context, in *pb.ChangeConfigOptionsRequest) (*pb.CoreInfoResponse, error)
- func (s *CoreService) CoreInfoListener(stream pb.Core_CoreInfoListenerServer) error
- func (s *CoreService) GenerateConfig(ctx context.Context, in *pb.GenerateConfigRequest) (*pb.GenerateConfigResponse, error)
- func (s *CoreService) GenerateWarpConfig(ctx context.Context, in *pb.GenerateWarpConfigRequest) (*pb.WarpGenerationResponse, error)
- func (s *CoreService) GetSystemInfo(stream pb.Core_GetSystemInfoServer) error
- func (s *CoreService) GetSystemProxyStatus(ctx context.Context, empty *pb.Empty) (*pb.SystemProxyStatus, error)
- func (s *CoreService) LogListener(stream pb.Core_LogListenerServer) error
- func (s *CoreService) MainOutboundsInfo(stream pb.Core_MainOutboundsInfoServer) error
- func (s *CoreService) OutboundsInfo(stream pb.Core_OutboundsInfoServer) error
- func (s *CoreService) Parse(ctx context.Context, in *pb.ParseRequest) (*pb.ParseResponse, error)
- func (s *CoreService) Restart(ctx context.Context, in *pb.StartRequest) (*pb.CoreInfoResponse, error)
- func (s *CoreService) SelectOutbound(ctx context.Context, in *pb.SelectOutboundRequest) (*pb.Response, error)
- func (s *CoreService) SetSystemProxyEnabled(ctx context.Context, in *pb.SetSystemProxyEnabledRequest) (*pb.Response, error)
- func (s *CoreService) Start(ctx context.Context, in *pb.StartRequest) (*pb.CoreInfoResponse, error)
- func (s *CoreService) StartService(ctx context.Context, in *pb.StartRequest) (*pb.CoreInfoResponse, error)
- func (s *CoreService) Stop(ctx context.Context, empty *pb.Empty) (*pb.CoreInfoResponse, error)
- func (s *CoreService) UrlTest(ctx context.Context, in *pb.UrlTestRequest) (*pb.Response, error)
- type HelloService
- type OldCommandClientHandler
- func (cch *OldCommandClientHandler) ClearLog()
- func (cch *OldCommandClientHandler) Connected()
- func (cch *OldCommandClientHandler) Disconnected(message string)
- func (cch *OldCommandClientHandler) InitializeClashMode(modeList libbox.StringIterator, currentMode string)
- func (cch *OldCommandClientHandler) UpdateClashMode(newMode string)
- func (cch *OldCommandClientHandler) WriteGroups(message libbox.OutboundGroupIterator)
- func (cch *OldCommandClientHandler) WriteLog(message string)
- func (cch *OldCommandClientHandler) WriteStatus(message *libbox.StatusMessage)
- type OutboundGroup
- type OutboundGroupItem
- type StatusMessage
- type TunnelService
- func (s *TunnelService) Exit(ctx context.Context, _ *pb.Empty) (*pb.TunnelResponse, error)
- func (s *TunnelService) Start(ctx context.Context, in *pb.TunnelStartRequest) (*pb.TunnelResponse, error)
- func (s *TunnelService) Status(ctx context.Context, _ *pb.Empty) (*pb.TunnelResponse, error)
- func (s *TunnelService) Stop(ctx context.Context, _ *pb.Empty) (*pb.TunnelResponse, error)
Constants ¶
View Source
const ( Stopped = "Stopped" Starting = "Starting" Started = "Started" Stopping = "Stopping" )
View Source
const ( EmptyConfiguration = "EmptyConfiguration" StartCommandServer = "StartCommandServer" CreateService = "CreateService" )
Variables ¶
View Source
var (
Box *libbox.BoxService
)
View Source
var CoreState = pb.CoreState_STOPPED
Functions ¶
func ChangeConfigOptions ¶
func ChangeConfigOptions(in *pb.ChangeConfigOptionsRequest) (*pb.CoreInfoResponse, error)
func GenerateConfig ¶
func GenerateConfig(in *pb.GenerateConfigRequest) (*pb.GenerateConfigResponse, error)
func GenerateWarpConfig ¶
func GenerateWarpConfig(in *pb.GenerateWarpConfigRequest) (*pb.WarpGenerationResponse, error)
func GetSystemProxyStatus ¶
func NewObserver ¶
func NewObserver[T any](listenerBufferSize int) *observable.Observer[T]
func NewService ¶
func NewService(options option.Options) (*libbox.BoxService, error)
func Parse ¶
func Parse(in *pb.ParseRequest) (*pb.ParseResponse, error)
func Restart ¶
func Restart(in *pb.StartRequest) (*pb.CoreInfoResponse, error)
func RunStandalone ¶
func RunStandalone(hiddifySettingPath string, configPath string, defaultConfig config.ConfigOptions) error
func SelectOutbound ¶
func SelectOutbound(in *pb.SelectOutboundRequest) (*pb.Response, error)
func SetCoreStatus ¶
func SetCoreStatus(state pb.CoreState, msgType pb.MessageType, message string) pb.CoreInfoResponse
func SetSystemProxyEnabled ¶
func Start ¶
func Start(in *pb.StartRequest) (*pb.CoreInfoResponse, error)
func StartCommand ¶
func StartCoreGrpcServer ¶
func StartGrpcServer ¶
func StartHelloGrpcServer ¶
func StartService ¶
func StartService(in *pb.StartRequest) (*pb.CoreInfoResponse, error)
func StartTunnelGrpcServer ¶
func StartTunnelService ¶
func Stop ¶
func Stop() (*pb.CoreInfoResponse, error)
func StopAndAlert ¶
func StopAndAlert(msgType pb.MessageType, message string)
func StopCommand ¶
Types ¶
type CommandClientHandler ¶
type CommandClientHandler struct {
// contains filtered or unexported fields
}
func (*CommandClientHandler) ClearLog ¶
func (cch *CommandClientHandler) ClearLog()
func (*CommandClientHandler) Connected ¶
func (cch *CommandClientHandler) Connected()
func (*CommandClientHandler) Disconnected ¶
func (cch *CommandClientHandler) Disconnected(message string)
func (*CommandClientHandler) InitializeClashMode ¶
func (cch *CommandClientHandler) InitializeClashMode(modeList libbox.StringIterator, currentMode string)
func (*CommandClientHandler) UpdateClashMode ¶
func (cch *CommandClientHandler) UpdateClashMode(newMode string)
func (*CommandClientHandler) WriteGroups ¶
func (cch *CommandClientHandler) WriteGroups(message libbox.OutboundGroupIterator)
func (*CommandClientHandler) WriteLog ¶
func (cch *CommandClientHandler) WriteLog(message string)
func (*CommandClientHandler) WriteStatus ¶
func (cch *CommandClientHandler) WriteStatus(message *libbox.StatusMessage)
type CommandServerHandler ¶
type CommandServerHandler struct {
// contains filtered or unexported fields
}
func (*CommandServerHandler) GetSystemProxyStatus ¶
func (csh *CommandServerHandler) GetSystemProxyStatus() *libbox.SystemProxyStatus
func (*CommandServerHandler) PostServiceClose ¶
func (csh *CommandServerHandler) PostServiceClose()
func (*CommandServerHandler) ServiceReload ¶
func (csh *CommandServerHandler) ServiceReload() error
func (*CommandServerHandler) SetSystemProxyEnabled ¶
func (csh *CommandServerHandler) SetSystemProxyEnabled(isEnabled bool) error
type ConfigResult ¶
type ConfigResult struct { Config string RefreshInterval int HiddifyConfigOptions *config.ConfigOptions }
type CoreService ¶
type CoreService struct {
pb.UnimplementedCoreServer
}
func (*CoreService) ChangeConfigOptions ¶
func (s *CoreService) ChangeConfigOptions(ctx context.Context, in *pb.ChangeConfigOptionsRequest) (*pb.CoreInfoResponse, error)
func (*CoreService) CoreInfoListener ¶
func (s *CoreService) CoreInfoListener(stream pb.Core_CoreInfoListenerServer) error
func (*CoreService) GenerateConfig ¶
func (s *CoreService) GenerateConfig(ctx context.Context, in *pb.GenerateConfigRequest) (*pb.GenerateConfigResponse, error)
func (*CoreService) GenerateWarpConfig ¶
func (s *CoreService) GenerateWarpConfig(ctx context.Context, in *pb.GenerateWarpConfigRequest) (*pb.WarpGenerationResponse, error)
func (*CoreService) GetSystemInfo ¶
func (s *CoreService) GetSystemInfo(stream pb.Core_GetSystemInfoServer) error
func (*CoreService) GetSystemProxyStatus ¶
func (s *CoreService) GetSystemProxyStatus(ctx context.Context, empty *pb.Empty) (*pb.SystemProxyStatus, error)
func (*CoreService) LogListener ¶
func (s *CoreService) LogListener(stream pb.Core_LogListenerServer) error
func (*CoreService) MainOutboundsInfo ¶
func (s *CoreService) MainOutboundsInfo(stream pb.Core_MainOutboundsInfoServer) error
func (*CoreService) OutboundsInfo ¶
func (s *CoreService) OutboundsInfo(stream pb.Core_OutboundsInfoServer) error
func (*CoreService) Parse ¶
func (s *CoreService) Parse(ctx context.Context, in *pb.ParseRequest) (*pb.ParseResponse, error)
func (*CoreService) Restart ¶
func (s *CoreService) Restart(ctx context.Context, in *pb.StartRequest) (*pb.CoreInfoResponse, error)
func (*CoreService) SelectOutbound ¶
func (s *CoreService) SelectOutbound(ctx context.Context, in *pb.SelectOutboundRequest) (*pb.Response, error)
func (*CoreService) SetSystemProxyEnabled ¶
func (s *CoreService) SetSystemProxyEnabled(ctx context.Context, in *pb.SetSystemProxyEnabledRequest) (*pb.Response, error)
func (*CoreService) Start ¶
func (s *CoreService) Start(ctx context.Context, in *pb.StartRequest) (*pb.CoreInfoResponse, error)
func (*CoreService) StartService ¶
func (s *CoreService) StartService(ctx context.Context, in *pb.StartRequest) (*pb.CoreInfoResponse, error)
func (*CoreService) Stop ¶
func (s *CoreService) Stop(ctx context.Context, empty *pb.Empty) (*pb.CoreInfoResponse, error)
func (*CoreService) UrlTest ¶
func (s *CoreService) UrlTest(ctx context.Context, in *pb.UrlTestRequest) (*pb.Response, error)
type HelloService ¶
type HelloService struct {
pb.UnimplementedHelloServer
}
func (*HelloService) SayHello ¶
func (s *HelloService) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloResponse, error)
func (*HelloService) SayHelloStream ¶
func (s *HelloService) SayHelloStream(stream pb.Hello_SayHelloStreamServer) error
type OldCommandClientHandler ¶
type OldCommandClientHandler struct {
// contains filtered or unexported fields
}
func (*OldCommandClientHandler) ClearLog ¶
func (cch *OldCommandClientHandler) ClearLog()
func (*OldCommandClientHandler) Connected ¶
func (cch *OldCommandClientHandler) Connected()
func (*OldCommandClientHandler) Disconnected ¶
func (cch *OldCommandClientHandler) Disconnected(message string)
func (*OldCommandClientHandler) InitializeClashMode ¶
func (cch *OldCommandClientHandler) InitializeClashMode(modeList libbox.StringIterator, currentMode string)
func (*OldCommandClientHandler) UpdateClashMode ¶
func (cch *OldCommandClientHandler) UpdateClashMode(newMode string)
func (*OldCommandClientHandler) WriteGroups ¶
func (cch *OldCommandClientHandler) WriteGroups(message libbox.OutboundGroupIterator)
func (*OldCommandClientHandler) WriteLog ¶
func (cch *OldCommandClientHandler) WriteLog(message string)
func (*OldCommandClientHandler) WriteStatus ¶
func (cch *OldCommandClientHandler) WriteStatus(message *libbox.StatusMessage)
type OutboundGroup ¶
type OutboundGroup struct { Tag string `json:"tag"` Type string `json:"type"` Selected string `json:"selected"` Items []*OutboundGroupItem `json:"items"` }
type OutboundGroupItem ¶
type StatusMessage ¶
type TunnelService ¶
type TunnelService struct {
pb.UnimplementedTunnelServiceServer
}
func (*TunnelService) Exit ¶
func (s *TunnelService) Exit(ctx context.Context, _ *pb.Empty) (*pb.TunnelResponse, error)
func (*TunnelService) Start ¶
func (s *TunnelService) Start(ctx context.Context, in *pb.TunnelStartRequest) (*pb.TunnelResponse, error)
func (*TunnelService) Status ¶
func (s *TunnelService) Status(ctx context.Context, _ *pb.Empty) (*pb.TunnelResponse, error)
func (*TunnelService) Stop ¶
func (s *TunnelService) Stop(ctx context.Context, _ *pb.Empty) (*pb.TunnelResponse, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.