Files
acme-dns/types.go

69 lines
1.3 KiB
Go
Raw Normal View History

2016-11-11 16:48:00 +02:00
package main
import (
"github.com/miekg/dns"
2016-11-13 14:50:44 +02:00
"github.com/satori/go.uuid"
2016-11-11 16:48:00 +02:00
)
2016-11-23 18:07:38 +02:00
// Records is for static records
2016-11-11 16:48:00 +02:00
type Records struct {
Records map[uint16]map[string][]dns.RR
}
2016-11-23 18:07:38 +02:00
// DNSConfig holds the config structure
2016-11-16 19:15:36 +02:00
type DNSConfig struct {
2016-11-13 14:50:44 +02:00
General general
2016-11-17 17:52:55 +02:00
Database dbsettings
2016-11-16 19:15:36 +02:00
API httpapi
2016-11-13 14:50:44 +02:00
Logconfig logconfig
2016-11-11 16:48:00 +02:00
}
2016-11-13 14:50:44 +02:00
// Auth middleware
2016-11-23 18:07:38 +02:00
type authMiddleware struct{}
2016-11-13 14:50:44 +02:00
2016-11-11 16:48:00 +02:00
// Config file general section
type general struct {
Domain string
Nsname string
Nsadmin string
2016-11-16 14:56:49 +02:00
Debug bool
StaticRecords []string `toml:"records"`
2016-11-13 14:50:44 +02:00
}
2016-11-17 17:52:55 +02:00
type dbsettings struct {
Engine string
Connection string
}
2016-11-13 14:50:44 +02:00
// API config
type httpapi struct {
2016-11-16 19:15:36 +02:00
Domain string
Port string
TLS string
TLSCertPrivkey string `toml:"tls_cert_privkey"`
TLSCertFullchain string `toml:"tls_cert_fullchain"`
CorsOrigins []string
2016-11-11 16:48:00 +02:00
}
2016-11-13 14:50:44 +02:00
// Logging config
type logconfig struct {
Level string `toml:"loglevel"`
Logtype string `toml:"logtype"`
File string `toml:"logfile"`
Format string `toml:"logformat"`
}
2016-11-23 18:07:38 +02:00
// ACMETxt is the default structure for the user controlled record
2016-11-13 14:50:44 +02:00
type ACMETxt struct {
Username uuid.UUID
Password string
ACMETxtPost
2016-11-17 17:52:55 +02:00
LastActive int64
2016-11-13 14:50:44 +02:00
}
2016-11-23 18:07:38 +02:00
// ACMETxtPost holds the DNS part of the ACMETxt struct
2016-11-13 14:50:44 +02:00
type ACMETxtPost struct {
Subdomain string `json:"subdomain"`
Value string `json:"txt"`
}