Documentation
¶
Index ¶
- type DNSController
- type Dependencies
- type InterfaceController
- type MarkRoutingController
- type RoutingController
- type StatusInfo
- type UnblockController
- type VpnerServer
- func (s *VpnerServer) DisableAllXrayRouting()
- func (s *VpnerServer) DnsManage(ctx context.Context, req *grpcpb.ManageRequest) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) HookRestore(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) InterfaceAdd(ctx context.Context, req *grpcpb.InterfaceActionRequest) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) InterfaceDel(ctx context.Context, req *grpcpb.InterfaceActionRequest) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) InterfaceList(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.InterfaceListResponse, error)
- func (s *VpnerServer) InterfaceScan(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.InterfaceListResponse, error)
- func (s *VpnerServer) MarkRoutingHealthy() bool
- func (s *VpnerServer) ReconcileRouting()
- func (s *VpnerServer) RestoreMarkRouting(table string)
- func (s *VpnerServer) RestoreXrayRouting(restoreV4, restoreV6 bool, table string)
- func (s *VpnerServer) RoutingHealthy() bool
- func (s *VpnerServer) Status(_ context.Context, _ *grpcpb.Empty) (*grpcpb.StatusResponse, error)
- func (s *VpnerServer) SyncRules(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) UnblockAdd(ctx context.Context, req *grpcpb.UnblockAddRequest) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) UnblockDel(ctx context.Context, req *grpcpb.UnblockDelRequest) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) UnblockList(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.UnblockListResponse, error)
- func (s *VpnerServer) XrayCreate(_ context.Context, req *grpcpb.XrayCreateRequest) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) XrayDelete(_ context.Context, req *grpcpb.XrayRequest) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) XrayList(_ context.Context, _ *grpcpb.Empty) (*grpcpb.XrayListResponse, error)
- func (s *VpnerServer) XrayManage(_ context.Context, req *grpcpb.XrayManageRequest) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) XraySetAutorun(_ context.Context, req *grpcpb.XrayAutoRunRequest) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) XrayTest(_ context.Context, req *grpcpb.XrayRequest) (*grpcpb.GenericResponse, error)
- func (s *VpnerServer) XrayUpdate(_ context.Context, req *grpcpb.XrayUpdateRequest) (*grpcpb.GenericResponse, error)
- type XrayController
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 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 UnblockController ¶
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 (s *VpnerServer) DnsManage(ctx context.Context, req *grpcpb.ManageRequest) (*grpcpb.GenericResponse, error)
func (*VpnerServer) HookRestore ¶
func (s *VpnerServer) HookRestore(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.GenericResponse, error)
func (*VpnerServer) InterfaceAdd ¶
func (s *VpnerServer) InterfaceAdd(ctx context.Context, req *grpcpb.InterfaceActionRequest) (*grpcpb.GenericResponse, error)
func (*VpnerServer) InterfaceDel ¶
func (s *VpnerServer) InterfaceDel(ctx context.Context, req *grpcpb.InterfaceActionRequest) (*grpcpb.GenericResponse, error)
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 (s *VpnerServer) Status(_ context.Context, _ *grpcpb.Empty) (*grpcpb.StatusResponse, error)
func (*VpnerServer) SyncRules ¶
func (s *VpnerServer) SyncRules(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.GenericResponse, error)
func (*VpnerServer) UnblockAdd ¶
func (s *VpnerServer) UnblockAdd(ctx context.Context, req *grpcpb.UnblockAddRequest) (*grpcpb.GenericResponse, error)
func (*VpnerServer) UnblockDel ¶
func (s *VpnerServer) UnblockDel(ctx context.Context, req *grpcpb.UnblockDelRequest) (*grpcpb.GenericResponse, error)
func (*VpnerServer) UnblockList ¶
func (s *VpnerServer) UnblockList(ctx context.Context, _ *grpcpb.Empty) (*grpcpb.UnblockListResponse, error)
func (*VpnerServer) XrayCreate ¶
func (s *VpnerServer) XrayCreate(_ context.Context, req *grpcpb.XrayCreateRequest) (*grpcpb.GenericResponse, error)
func (*VpnerServer) XrayDelete ¶
func (s *VpnerServer) XrayDelete(_ context.Context, req *grpcpb.XrayRequest) (*grpcpb.GenericResponse, error)
func (*VpnerServer) XrayList ¶
func (s *VpnerServer) XrayList(_ context.Context, _ *grpcpb.Empty) (*grpcpb.XrayListResponse, error)
func (*VpnerServer) XrayManage ¶
func (s *VpnerServer) XrayManage(_ context.Context, req *grpcpb.XrayManageRequest) (*grpcpb.GenericResponse, error)
func (*VpnerServer) XraySetAutorun ¶
func (s *VpnerServer) XraySetAutorun(_ context.Context, req *grpcpb.XrayAutoRunRequest) (*grpcpb.GenericResponse, error)
func (*VpnerServer) XrayTest ¶
func (s *VpnerServer) XrayTest(_ context.Context, req *grpcpb.XrayRequest) (*grpcpb.GenericResponse, error)
func (*VpnerServer) XrayUpdate ¶
func (s *VpnerServer) XrayUpdate(_ context.Context, req *grpcpb.XrayUpdateRequest) (*grpcpb.GenericResponse, error)
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)
}
Click to show internal directories.
Click to hide internal directories.