reCoreD-UI/models/settings.go

28 lines
453 B
Go
Raw Normal View History

2024-04-03 09:05:12 +00:00
package models
2024-04-11 02:51:50 +00:00
import (
"fmt"
"gorm.io/gorm"
)
2024-04-03 09:05:12 +00:00
const (
SettingsKeyAdminUsername = "admin.username"
SettingsKeyAdminPassword = "admin.password"
SettingsKeyDNSServer = "dns.servers"
)
type Settings struct {
gorm.Model
2024-04-11 02:51:50 +00:00
Key string `gorm:"unique;not null;size:255"`
Value string `gorm:"not null;size:255"`
}
func (s Settings) String() string {
return fmt.Sprintf("%s: %s", s.Key, s.Value)
}
type ISettings interface {
String() string
2024-04-03 09:05:12 +00:00
}