Documentation
¶
Index ¶
- type Config
- type Credentials
- type Manager
- func (m *Manager) ConfigExists() bool
- func (m *Manager) ConfigPath() string
- func (m *Manager) GetConfig() *Config
- func (m *Manager) LoadConfig() error
- func (m *Manager) LoadCredentials(password string, path string) (*Credentials, error)
- func (m *Manager) SaveConfig(cfg *Config) error
- func (m *Manager) SaveCredentials(creds *Credentials, password string, path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Credentials ¶
type Credentials struct {
Server string `json:"server"`
Username string `json:"username"`
Password string `json:"password"`
Group int `json:"group"`
OTPSecret string `json:"otp_secret"`
}
func (*Credentials) Validate ¶
func (c *Credentials) Validate() error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func (*Manager) ConfigExists ¶
ConfigExists checks if the configuration file is present
func (*Manager) ConfigPath ¶
ConfigPath returns the path to the main application configuration file
func (*Manager) LoadConfig ¶
LoadConfig reads the configuration from the file system
func (*Manager) LoadCredentials ¶
func (m *Manager) LoadCredentials(password string, path string) (*Credentials, error)
LoadCredentials reads and decrypts VPN credentials from a file
func (*Manager) SaveConfig ¶
SaveConfig persists the configuration to disk and updates in-memory state
func (*Manager) SaveCredentials ¶
func (m *Manager) SaveCredentials(creds *Credentials, password string, path string) error
SaveCredentials encrypts and saves VPN credentials to a file
Click to show internal directories.
Click to hide internal directories.