model

package
v0.0.0-...-5d87fb3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CName

type CName struct {
	gorm.Model
	Hostname string `gorm:"not null" form:"hostname" validate:"required,hostname"`
	Target   Host   `validate:"required,hostname"`
	TargetID uint
	Ttl      int `form:"ttl" validate:"required,min=20,max=86400"`
}

CName is a dns cname entry.

type Host

type Host struct {
	gorm.Model
	Hostname   string    `gorm:"unique_index:idx_host_domain;not null" form:"hostname" validate:"required,hostname"`
	Domain     string    `gorm:"unique_index:idx_host_domain;not null" form:"domain" validate:"required,hostname"`
	Ip         string    `form:"ip" validate:"omitempty,ipv4|ipv6"`
	Ttl        int       `form:"ttl" validate:"required,min=20,max=86400"`
	LastUpdate time.Time `form:"lastupdate"`
	UserName   string    `gorm:"unique" form:"username" validate:"min=3"`
	Password   string    `form:"password" validate:"min=8"`
}

Host is a dns host entry.

func (*Host) UpdateHost

func (h *Host) UpdateHost(updateHost *Host) (updateRecord bool)

UpdateHost updates all fields of a host entry and sets a new LastUpdate date.

type Log

type Log struct {
	gorm.Model
	Status    bool
	Message   string
	Host      Host
	HostID    uint
	SentIP    string
	CallerIP  string
	TimeStamp time.Time
	UserAgent string
}

Log defines a log entry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL