- settings: get filter choices from storage for settings validation - updater: update servers to the storage - storage: minimal deep copying and data duplication - storage: add merged servers mutex for thread safety - connection: filter servers in storage - formatter: format servers to Markdown in storage - PIA: get server by name from storage directly - Updater: get servers count from storage directly - Updater: equality check done in storage, fix #882
29 lines
472 B
Go
29 lines
472 B
Go
package state
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/qdm12/gluetun/internal/configuration/settings"
|
|
"github.com/qdm12/gluetun/internal/loopstate"
|
|
)
|
|
|
|
var _ Manager = (*State)(nil)
|
|
|
|
type Manager interface {
|
|
SettingsGetSetter
|
|
}
|
|
|
|
func New(statusApplier loopstate.Applier, vpn settings.VPN) *State {
|
|
return &State{
|
|
statusApplier: statusApplier,
|
|
vpn: vpn,
|
|
}
|
|
}
|
|
|
|
type State struct {
|
|
statusApplier loopstate.Applier
|
|
|
|
vpn settings.VPN
|
|
settingsMu sync.RWMutex
|
|
}
|