Files
Sylve/internal/db/models/system.go
T
2026-03-04 03:15:59 +01:00

55 lines
1.7 KiB
Go

// SPDX-License-Identifier: BSD-2-Clause
//
// Copyright (c) 2025 The FreeBSD Foundation.
//
// This software was developed by Hayzam Sherif <hayzam@alchemilla.io>
// of Alchemilla Ventures Pvt. Ltd. <hello@alchemilla.io>,
// under sponsorship from the FreeBSD Foundation.
package models
import "time"
type DefaultRoutes struct {
IPv4 string `json:"ipv4"`
IPv6 string `json:"ipv6"`
}
type System struct {
ID int `json:"id" gorm:"primaryKey"`
Initialized bool `json:"initialized"`
Hostname string `json:"hostname"`
DefaultRoutes DefaultRoutes `json:"defaultRoutes" gorm:"embedded"`
ISODir string `json:"isoDir"`
}
type PassedThroughIDs struct {
ID int `json:"id" gorm:"primaryKey"`
Domain int `json:"domain"`
OldDriver string `json:"oldDriver"`
DeviceID string `json:"deviceID" gorm:"uniqueIndex"`
}
type Triggers struct {
ID int `json:"id" gorm:"primaryKey"`
Action string `json:"action"`
Data string `json:"data"`
Completed bool `json:"completed"`
CreatedAt time.Time `json:"createdAt" gorm:"autoCreateTime"`
CompletedAt time.Time `json:"completedAt" gorm:"autoUpdateTime"`
}
type NetlinkEvent struct {
ID uint `json:"id" gorm:"primaryKey"`
System string `json:"system" gorm:"index"`
Subsystem string `json:"subsystem"`
Type string `json:"type" gorm:"index"`
Attrs map[string]string `json:"attrs" gorm:"serializer:json"`
Raw string `json:"raw" gorm:"type:text"`
Processed bool `json:"processed" gorm:"index"`
CreatedAt time.Time `json:"createdAt" gorm:"autoCreateTime;index"`
UpdatedAt time.Time `json:"updatedAt" gorm:"autoUpdateTime"`
}