wireguard-dashboard/model/vo/client.go

42 lines
1.8 KiB
Go
Raw Normal View History

2024-03-11 14:53:28 +08:00
package vo
import (
"wireguard-dashboard/model/entity"
"wireguard-dashboard/model/template_data"
)
type Client struct {
Id string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
SubnetRange string `json:"subnetRange"`
2024-03-14 15:23:16 +08:00
IpAllocation []string `json:"ipAllocation" gorm:"-"`
IpAllocationStr string `json:"-" gorm:"ipAllocationStr"`
AllowedIps []string `json:"allowedIPS" gorm:"-"`
AllowedIpsStr string `json:"-" gorm:"allowedIPSStr"`
2024-05-24 15:19:26 +08:00
ExtraAllowedIps []string `json:"extraAllowedIPS" gorm:"-"`
ExtraAllowedIpsStr string `json:"-" gorm:"extraAllowedIPSStr"` // extra_allowed_ips_str
2024-03-11 14:53:28 +08:00
Endpoint string `json:"endpoint"`
UseServerDNS int `json:"useServerDNS"`
EnableAfterCreation int `json:"enableAfterCreation"`
KeysStr string `json:"-" gorm:"keys_str"`
Keys template_data.Keys `json:"keys" gorm:"-"`
CreateUser string `json:"createUser"`
Enabled bool `json:"enabled"`
OfflineMonitoring int `json:"offlineMonitoring"`
2024-05-24 15:19:26 +08:00
CreatedAt entity.JsonTime `json:"createdAt"`
2024-03-11 14:53:28 +08:00
UpdatedAt entity.JsonTime `json:"updatedAt"`
}
2024-03-15 15:17:40 +08:00
type ClientStatus struct {
ID string `json:"id"`
2024-03-15 15:17:40 +08:00
Name string `json:"name"`
Email string `json:"email"`
2024-06-04 09:55:48 +08:00
IpAllocation string `json:"ipAllocation"`
2024-03-15 15:17:40 +08:00
Endpoint string `json:"endpoint"`
Received string `json:"received"`
Transmitted string `json:"transmitted"`
IsOnline bool `json:"isOnline"` // 是否在线 1 - 在线 | 0 - 不在线
LastHandShake string `json:"lastHandShake"`
}