proxy

package
v0.0.0-...-3adb80e Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BusServiceName = "org.deepin.dde.NetworkProxy1"
	BusPath        = "/org/deepin/dde/NetworkProxy1"
	BusInterface   = BusServiceName
)

Variables

This section is empty.

Functions

func UnMarshalProxy

func UnMarshalProxy(buf []byte) (config.Proxy, error)

unmarshal buf to proxy

Types

type AppProxy

type AppProxy struct {
	// contains filtered or unexported fields
}

func NewAppProxy

func NewAppProxy() *AppProxy

create app proxy

func (AppProxy) AddProc

func (mgr AppProxy) AddProc(pid int32) *dbus.Error

add pid to proc

func (AppProxy) AddProxy

func (mgr AppProxy) AddProxy(proto string, name string, jsonProxy []byte) *dbus.Error

set proxy

func (*AppProxy) AddProxyApps

func (mgr *AppProxy) AddProxyApps(apps []string) *dbus.Error

add proxy app

func (AppProxy) ClearProxy

func (mgr AppProxy) ClearProxy() *dbus.Error

func (*AppProxy) DelProxyApps

func (mgr *AppProxy) DelProxyApps(apps []string) *dbus.Error

delete proxy app

func (AppProxy) GetCGroups

func (mgr AppProxy) GetCGroups() (string, *dbus.Error)

cgroups

func (AppProxy) GetInterfaceName

func (mgr AppProxy) GetInterfaceName() string

interface path

func (AppProxy) GetProxy

func (mgr AppProxy) GetProxy() (string, *dbus.Error)

get proxy

func (AppProxy) SetProxies

func (mgr AppProxy) SetProxies(proxies config.ScopeProxies) *dbus.Error

set proxies

func (AppProxy) StartProxy

func (mgr AppProxy) StartProxy(sender dbus.Sender, proto string, name string, udp bool) *dbus.Error

start proxy

func (AppProxy) StopProxy

func (mgr AppProxy) StopProxy() *dbus.Error

stop proxy

type BaseProxy

type BaseProxy interface {
	// DBus method
	StartProxy(sender dbus.Sender, proto string, name string, udp bool) *dbus.Error
	StopProxy() *dbus.Error
	SetProxies(proxies config.ScopeProxies) *dbus.Error
	ClearProxy() *dbus.Error
	GetProxy() (string, *dbus.Error)
	AddProxy(proto string, name string, jsonProxy []byte) *dbus.Error
	GetCGroups() (string, *dbus.Error)
	// contains filtered or unexported methods
}

type GlobalProxy

type GlobalProxy struct {

	// no proxy app
	IgnoreApp []string
	// contains filtered or unexported fields
}

func NewGlobalProxy

func NewGlobalProxy() *GlobalProxy

func (GlobalProxy) AddProc

func (mgr GlobalProxy) AddProc(pid int32) *dbus.Error

add pid to proc

func (GlobalProxy) AddProxy

func (mgr GlobalProxy) AddProxy(proto string, name string, jsonProxy []byte) *dbus.Error

set proxy

func (GlobalProxy) ClearProxy

func (mgr GlobalProxy) ClearProxy() *dbus.Error

func (GlobalProxy) GetCGroups

func (mgr GlobalProxy) GetCGroups() (string, *dbus.Error)

cgroups

func (GlobalProxy) GetInterfaceName

func (mgr GlobalProxy) GetInterfaceName() string

interface path

func (GlobalProxy) GetProxy

func (mgr GlobalProxy) GetProxy() (string, *dbus.Error)

get proxy

func (*GlobalProxy) IgnoreProxyApps

func (mgr *GlobalProxy) IgnoreProxyApps(apps []string) *dbus.Error

add proxy app

func (GlobalProxy) SetProxies

func (mgr GlobalProxy) SetProxies(proxies config.ScopeProxies) *dbus.Error

set proxies

func (GlobalProxy) StartProxy

func (mgr GlobalProxy) StartProxy(sender dbus.Sender, proto string, name string, udp bool) *dbus.Error

start proxy

func (GlobalProxy) StopProxy

func (mgr GlobalProxy) StopProxy() *dbus.Error

stop proxy

func (*GlobalProxy) UnIgnoreProxyApps

func (mgr *GlobalProxy) UnIgnoreProxyApps(apps []string) *dbus.Error

delete proxy app

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

manage all proxy handler

func NewManager

func NewManager() *Manager

make manager

func (*Manager) Export

func (m *Manager) Export() error

create handler and export service

func (*Manager) GetAllProcs

func (m *Manager) GetAllProcs() (map[string]cgroups.ControlProcSl, error)

format current procs

func (*Manager) Init

func (m *Manager) Init() error

inti manager

func (*Manager) Listen

func (m *Manager) Listen() error

start listen

func (*Manager) LoadConfig

func (m *Manager) LoadConfig() error

load config

func (*Manager) Start

func (m *Manager) Start()

only run once method

func (*Manager) Wait

func (m *Manager) Wait()

func (*Manager) WriteConfig

func (m *Manager) WriteConfig() error

write config

Jump to

Keyboard shortcuts

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