v2

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2024 License: GPL-3.0 Imports: 32 Imported by: 1

Documentation

Index

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 CoreState = pb.CoreState_STOPPED

Functions

func GetSystemProxyStatus

func GetSystemProxyStatus(ctx context.Context, empty *pb.Empty) (*pb.SystemProxyStatus, error)

func Log

func Log(level pb.LogLevel, typ pb.LogType, message string)

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 SetSystemProxyEnabled(ctx context.Context, in *pb.SetSystemProxyEnabledRequest) (*pb.Response, error)

func Setup

func Setup(basePath string, workingPath string, tempPath string, statusPort int64, debug bool) error

func Start

func Start(in *pb.StartRequest) (*pb.CoreInfoResponse, error)

func StartCommand

func StartCommand(command int32, port int64) error

func StartCoreGrpcServer

func StartCoreGrpcServer(listenAddressG string) error

func StartGrpcServer

func StartGrpcServer(listenAddressG string, service string) error

func StartHelloGrpcServer

func StartHelloGrpcServer(listenAddressG string) error

func StartService

func StartService(in *pb.StartRequest) (*pb.CoreInfoResponse, error)

func StartTunnelGrpcServer

func StartTunnelGrpcServer(listenAddressG string) error

func StartTunnelService

func StartTunnelService(goArg string) (int, string)

func Stop

func Stop() (*pb.CoreInfoResponse, error)

func StopAndAlert

func StopAndAlert(msgType pb.MessageType, message string)

func StopCommand

func StopCommand(command int32) error

func UrlTest

func UrlTest(in *pb.UrlTestRequest) (*pb.Response, error)

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 (*CoreService) GenerateWarpConfig

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 (*CoreService) Restart

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 (*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 OutboundGroupItem struct {
	Tag          string `json:"tag"`
	Type         string `json:"type"`
	URLTestTime  int64  `json:"url-test-time"`
	URLTestDelay int32  `json:"url-test-delay"`
}

type StatusMessage

type StatusMessage struct {
	Status  string  `json:"status"`
	Alert   *string `json:"alert"`
	Message *string `json:"message"`
}

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 (*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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL