models

package
v0.0.0-...-3e46209 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLeRecord

func AddLeRecord(token, leDomain, leToken string) (err error)

func DeleteDns

func DeleteDns(token string) (err error)

func DeleteLeRecord

func DeleteLeRecord(token, leDomain string) (err error)

func DownloadData

func DownloadData(url string) (bodyBytes []byte, err error)

func GetPdnsRecords

func GetPdnsRecords(h *Host) (records []string)

func Init

func Init(logSql bool) (err error)

func ListCronEntries

func ListCronEntries() []*cron.Entry

func RegisterDns

func RegisterDns(mainzone, subzone, token, ip string) (err error, newToken string)

func UpdateDns

func UpdateDns(token, ip string) (err error)

Types

type CronJob

type CronJob struct {
	cron.Job
	Func func()
	Name string
}

func (CronJob) Run

func (f CronJob) Run()

type Host

type Host struct {
	ID        int64      `gorm:"primary_key" json:"-"`
	Hostname  string     `json:"mainzone"`
	Subzones  string     `json:"subzones"`
	IP        string     `json:"ip"`
	Token     string     `json:"token,omitempty"`
	UpdatedAt *time.Time `gorm:"type:timestamp" json:"updated_at,omitempty"`
}

func GetAllHosts

func GetAllHosts() (hosts []Host, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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