Added more documentation and prepared some structural changes

This commit is contained in:
Ben
2021-07-27 13:12:16 +02:00
parent d84bcbeef6
commit ef96496474
8 changed files with 169 additions and 116 deletions
+3
View File
@@ -6,6 +6,7 @@ import (
"github.com/jinzhu/gorm"
)
// Host is a dns host entry.
type Host struct {
gorm.Model
Hostname string `gorm:"unique_index:idx_host_domain;not null" form:"hostname" validate:"required,hostname"`
@@ -17,6 +18,8 @@ type Host struct {
Password string `form:"password" validate:"min=8"`
}
// UpdateHost updates all fields of a host entry
// and sets a new LastUpdate date.
func (h *Host) UpdateHost(updateHost *Host) (updateRecord bool) {
updateRecord = false
if h.Ip != updateHost.Ip || h.Ttl != updateHost.Ttl {
+1
View File
@@ -6,6 +6,7 @@ import (
"github.com/jinzhu/gorm"
)
// Log defines a log entry.
type Log struct {
gorm.Model
Status bool