-
Notifications
You must be signed in to change notification settings - Fork 2
/
model.go
34 lines (31 loc) · 923 Bytes
/
model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
import "github.com/nettica-com/nettica-admin/model"
type Server struct {
Name string `json:"name"`
Path string `json:"path"`
Config model.Message `json:"config"`
Body []byte `json:"body"`
Running chan bool `json:"-"`
Shutdown bool `json:"-"`
Worker *Worker `json:"-"`
}
type ClientWorker interface {
StartServer()
FailSafe()
DiscoverDevice()
CallNettica(etag string) ([]byte, error)
GetNetticaDevice() (*model.Device, error)
UpdateNetticaDevice(device *model.Device) error
GetNetticaVPN(etag string) (string, error)
UpdateVPN(vpn *model.VPN) error
DeleteVPN(id string) error
UpdateNetticaConfig(body []byte)
ValidateMessage(msg *model.Message) error
FindVPN(net string) (*model.VPN, *[]model.VPN, error)
StopAllVPNs() error
StartBackgroundRefreshService()
}
type Client struct {
ClientWorker
Context *Server `json:"context"`
}