gui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Config     AppConfig
	ConfigPath string
	// contains filtered or unexported fields
}

App struct

func NewApp

func NewApp() *App

NewApp creates a new App application struct

func (*App) AddProfile

func (a *App) AddProfile(profile ProxyProfile) error

AddProfile adds a new profile

func (*App) GetActiveConfigName

func (a *App) GetActiveConfigName() string

GetActiveConfigName returns the name of the currently active config

func (*App) GetAppSettings

func (a *App) GetAppSettings() AppConfig

GetAppSettings returns the current application settings

func (*App) GetProfiles

func (a *App) GetProfiles() []ProxyProfile

GetProfiles returns all profiles

func (*App) HideWindow

func (a *App) HideWindow()

HideWindow hides the main application window

func (*App) IsProxyRunning

func (a *App) IsProxyRunning() bool

IsProxyRunning returns the current proxy status

func (*App) LoadConfig

func (a *App) LoadConfig(path string) error

LoadConfig loads the app configuration from file

func (*App) Quit

func (a *App) Quit()

Quit quits the application

func (*App) RemoveProfile

func (a *App) RemoveProfile(name string) error

RemoveProfile removes a profile

func (*App) SaveConfig

func (a *App) SaveConfig() error

SaveConfig saves the app configuration to file

func (*App) SetContext

func (a *App) SetContext(ctx *wails.Context)

SetContext sets the wails context

func (*App) SetDefaultProfile

func (a *App) SetDefaultProfile(name string) error

SetDefaultProfile sets the default profile

func (*App) SetSystemProxyMode

func (a *App) SetSystemProxyMode(mode string) error

SetSystemProxyMode sets the system proxy mode

func (*App) ShowWindow

func (a *App) ShowWindow()

ShowWindow shows the main application window

func (*App) StartProxyByName

func (a *App) StartProxyByName(name string) error

StartProxyByName starts the proxy using the named profile

func (*App) StopProxy

func (a *App) StopProxy() error

StopProxy stops the current proxy

func (*App) UpdateAppSettings

func (a *App) UpdateAppSettings(settings AppConfig) error

UpdateAppSettings updates the application settings

type AppConfig

type AppConfig struct {
	Profiles         []ProxyProfile `json:"profiles"`
	DefaultProfile   string         `json:"defaultProfile"`
	AutoStartProxy   bool           `json:"autoStartProxy"`
	EnableSystemTray bool           `json:"enableSystemTray"`
	SystemProxyMode  string         `json:"systemProxyMode"` // "pac", "global", "disabled"
	PacURL           string         `json:"pacUrl"`
	PacPort          int            `json:"pacPort"`
	SocksPort        int            `json:"socksPort"`
	HttpPort         int            `json:"httpPort"`
}

AppConfig represents the application configuration

type ProxyProfile

type ProxyProfile struct {
	Name        string `json:"name"`
	ConfigText  string `json:"configText"`
	Description string `json:"description"`
	LastUsed    string `json:"lastUsed,omitempty"`
}

ProxyProfile represents a proxy configuration profile

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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