rpc

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DNSController

type DNSController interface {
	Start() error
	Stop()
	IsRunning() bool
	UpstreamStats() []resolver.ServerStat
	QueryStats() resolver.QueryStats
	ResyncRules(ctx context.Context) (dnssvc.SyncReport, error)
}

type Dependencies

type Dependencies struct {
	DNS              DNSController
	Unblock          UnblockController
	InterfaceManager InterfaceController
	XrayService      XrayController
	XrayRouter       RoutingController
	MarkRouter       MarkRoutingController
	Info             StatusInfo
	IPSetCounts      func() (v4, v6 int64)
}

type InterfaceController

type InterfaceController interface {
	LoadInterfacesFromFile() (*netif.VPNInterfaces, error)
	FetchInterfaces() (map[string]netif.Interface, error)
	AddInterface(id string) error
	DeleteInterface(id string) error
	LookupTracked(name string) (netif.Interface, bool)
	SystemNameResolver() func(id string) (string, error)
}

type MarkRoutingController

type MarkRoutingController interface {
	Apply(vpnType, chain string, resolveIface func() (string, error)) error
	Sync(vpnType, chain string, resolveIface func() (string, error)) error
	Remove(vpnType, chain string) error
	Intact(vpnType, chain string) bool
}

type RoutingController

type RoutingController interface {
	Apply(chain string, info proxy.ChainInfo) error
	Remove(chain string) error
	Restore(info map[string]proxy.ChainInfo, isRunning func(string) bool, restoreV4, restoreV6 bool, table string)
	Shutdown()
	ClearAppliedState(table string, clearV4, clearV6 bool)
	ResetStateFamily(resetV4, resetV6 bool)
	RoutingIntact() bool
}

type StatusInfo

type StatusInfo struct {
	Version       string
	StartedAt     time.Time
	DNSPort       int
	TProxyEnabled bool
}

type UnblockController

type UnblockController interface {
	List() ([]unblock.RuleGroup, error)
	AddRule(chainName, pattern string) (string, error)
	DeleteRule(pattern string) (string, string, error)
	DeleteChain(vpnType, chainName string) error
	RuleCount(vpnType, chainName string) int
}

type VpnerServer

type VpnerServer struct {
	grpcpb.UnimplementedVpnerManagerServer
	// contains filtered or unexported fields
}

func NewVpnerServer

func NewVpnerServer(deps Dependencies) *VpnerServer

func (*VpnerServer) DisableAllXrayRouting

func (s *VpnerServer) DisableAllXrayRouting()

func (*VpnerServer) DnsManage

func (*VpnerServer) HookRestore

func (s *VpnerServer) HookRestore(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.GenericResponse, error)

func (*VpnerServer) InterfaceAdd

func (*VpnerServer) InterfaceDel

func (*VpnerServer) InterfaceList

func (s *VpnerServer) InterfaceList(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.InterfaceListResponse, error)

func (*VpnerServer) InterfaceScan

func (s *VpnerServer) InterfaceScan(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.InterfaceListResponse, error)

func (*VpnerServer) MarkRoutingHealthy

func (s *VpnerServer) MarkRoutingHealthy() bool

func (*VpnerServer) ReconcileRouting

func (s *VpnerServer) ReconcileRouting()

func (*VpnerServer) RestoreMarkRouting

func (s *VpnerServer) RestoreMarkRouting(table string)

func (*VpnerServer) RestoreXrayRouting

func (s *VpnerServer) RestoreXrayRouting(restoreV4, restoreV6 bool, table string)

func (*VpnerServer) RoutingHealthy

func (s *VpnerServer) RoutingHealthy() bool

func (*VpnerServer) Status

func (*VpnerServer) SyncRules

func (s *VpnerServer) SyncRules(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.GenericResponse, error)

func (*VpnerServer) UnblockAdd

func (*VpnerServer) UnblockDel

func (*VpnerServer) UnblockList

func (s *VpnerServer) UnblockList(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.UnblockListResponse, error)

func (*VpnerServer) XrayCreate

func (*VpnerServer) XrayDelete

func (*VpnerServer) XrayList

func (*VpnerServer) XrayManage

func (*VpnerServer) XraySetAutorun

func (*VpnerServer) XrayTest

func (*VpnerServer) XrayUpdate

type XrayController

type XrayController interface {
	StartAuto() error
	StartOne(string) error
	StopOne(string) error
	IsRunning(string) bool
	ListInfo() (map[string]proxy.ChainInfo, error)
	GetInfo(string) (proxy.ChainInfo, error)
	Create(link string, autoRun bool) (string, error)
	Update(name, link string) error
	Delete(name string) error
	SetAutorun(name string, autoRun bool) error
	IsChain(name string) bool
	Runtimes() map[string]proxysvc.ChainRuntime
	Test(name string) (string, error)
}

Jump to

Keyboard shortcuts

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