chore(all): memory and thread safe storage
- 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
This commit is contained in:
@@ -2,11 +2,14 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
)
|
||||
|
||||
type Storage struct {
|
||||
mergedServers models.AllServers
|
||||
mergedMutex sync.RWMutex
|
||||
// this is stored in memory to avoid re-parsing
|
||||
// the embedded JSON file on every call to the
|
||||
// SyncServers method.
|
||||
|
||||
Reference in New Issue
Block a user