Abstracts database storage & Status page UI (#88)

This commit is contained in:
Georgios Komninos 2021-08-28 15:10:30 +02:00 committed by GitHub
parent 7bb80c0c2e
commit b7c0990dcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 456 additions and 256 deletions

19
store/store.go Normal file
View file

@ -0,0 +1,19 @@
package store
import (
"github.com/ngoduykhanh/wireguard-ui/model"
)
type IStore interface {
Init() error
GetUser() (model.User, error)
GetGlobalSettings() (model.GlobalSetting, error)
GetServer() (model.Server, error)
GetClients(hasQRCode bool) ([]model.ClientData, error)
GetClientByID(clientID string, hasQRCode bool) (model.ClientData, error)
SaveClient(client model.Client) error
DeleteClient(clientID string) error
SaveServerInterface(serverInterface model.ServerInterface) error
SaveServerKeyPair(serverKeyPair model.ServerKeypair) error
SaveGlobalSettings(globalSettings model.GlobalSetting) error
}