mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-12 14:01:49 +03:00
Creates a layer of abstraction for database so we can change storage if needed
This commit is contained in:
parent
0f7acc4ec4
commit
5559e028e2
5 changed files with 210 additions and 231 deletions
19
store/store.go
Normal file
19
store/store.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue