mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-27 23:45:45 +08:00
Merge pull request #1833 from gravitl/GRA-821-host-model
new host model
This commit is contained in:
commit
f267648286
1 changed files with 34 additions and 0 deletions
34
models/host.go
Normal file
34
models/host.go
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
package models
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Host - represents a host on the network
|
||||||
|
type Host struct {
|
||||||
|
ID uuid.UUID `json:"id" yaml:"id"`
|
||||||
|
Verbosity int `json:"verbosity" yaml:"verbosity"`
|
||||||
|
FirewallInUse string `json:"firewallinuse" yaml:"firewallinuse"`
|
||||||
|
Version string `json:"version" yaml:"version"`
|
||||||
|
IPForwarding bool `json:"ipforwarding" yaml:"ipforwarding"`
|
||||||
|
DaemonInstalled bool `json:"daemoninstalled" yaml:"daemoninstalled"`
|
||||||
|
HostPass string `json:"hostpass" yaml:"hostpass"`
|
||||||
|
Name string `json:"name" yaml:"name"`
|
||||||
|
OS string `json:"os" yaml:"os"`
|
||||||
|
Debug bool `json:"debug" yaml:"debug"`
|
||||||
|
NodePassword string `json:"nodepassword" yaml:"nodepassword"`
|
||||||
|
ListenPort int `json:"listenport" yaml:"listenport"`
|
||||||
|
LocalAddress net.IPNet `json:"localaddress" yaml:"localaddress"`
|
||||||
|
LocalRange net.IPNet `json:"localrange" yaml:"localrange"`
|
||||||
|
LocalListenPort int `json:"locallistenport" yaml:"locallistenport"`
|
||||||
|
ProxyListenPort int `json:"proxy_listen_port" yaml:"proxy_listen_port"`
|
||||||
|
MTU int `json:"mtu" yaml:"mtu"`
|
||||||
|
PublicKey wgtypes.Key `json:"publickey" yaml:"publickey"`
|
||||||
|
MacAddress net.HardwareAddr `json:"macaddress" yaml:"macaddress"`
|
||||||
|
TrafficKeyPublic []byte `json:"traffickeypublic" yaml:"trafficekeypublic"`
|
||||||
|
InternetGateway net.UDPAddr `json:"internetgateway" yaml:"internetgateway"`
|
||||||
|
Nodes []Node `json:"nodes" yaml:"nodes"`
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue