-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.go
52 lines (45 loc) · 1.55 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package ipam
import (
"time"
uuid "github.com/satori/go.uuid"
"github.com/lovi-cloud/satelit/internal/mysql/types"
)
// A Subnet is subnet information
type Subnet struct {
UUID uuid.UUID `db:"uuid"`
Name string `db:"name"`
VLANID uint32 `db:"vlan_id"`
Network types.IPNet `db:"network"`
Start types.IP `db:"start"`
End types.IP `db:"end"`
Gateway *types.IP `db:"gateway"`
DNSServer *types.IP `db:"dns_server"`
MetadataServer *types.IP `db:"metadata_server"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
// A Address is address IP address information
type Address struct {
UUID uuid.UUID `db:"uuid"`
IP types.IP `db:"ip"`
SubnetID uuid.UUID `db:"subnet_id"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
// A Lease is DHCP lease information
type Lease struct {
UUID uuid.UUID `db:"uuid"`
MacAddress types.HardwareAddr `db:"mac_address"`
AddressID uuid.UUID `db:"address_id"`
CreatedAt time.Time `db:"created_at"`
UpdatedAt time.Time `db:"updated_at"`
}
// A DHCPLease is DHCP response information
type DHCPLease struct {
MacAddress types.HardwareAddr `db:"mac_address"`
IP types.IP `db:"ip"`
Network types.IPNet `db:"network"`
Gateway *types.IP `db:"gateway"`
DNSServer *types.IP `db:"dns_server"`
MetadataServer *types.IP `db:"metadata_server"`
}