1
0
mirror of https://github.com/joohoi/acme-dns.git synced 2025-01-13 00:05:33 +07:00
acme-dns/types.go

63 lines
1.1 KiB
Go
Raw Normal View History

2016-11-11 21:48:00 +07:00
package main
import (
"github.com/miekg/dns"
2016-11-13 19:50:44 +07:00
"github.com/satori/go.uuid"
"time"
2016-11-11 21:48:00 +07:00
)
// Static records
type Records struct {
Records map[uint16]map[string][]dns.RR
}
// Config file main struct
2016-11-17 00:15:36 +07:00
type DNSConfig struct {
2016-11-13 19:50:44 +07:00
General general
2016-11-17 00:15:36 +07:00
API httpapi
2016-11-13 19:50:44 +07:00
Logconfig logconfig
2016-11-11 21:48:00 +07:00
}
2016-11-13 19:50:44 +07:00
// Auth middleware
type AuthMiddleware struct{}
2016-11-11 21:48:00 +07:00
// Config file general section
type general struct {
Domain string
Nsname string
Nsadmin string
2016-11-16 19:56:49 +07:00
Debug bool
StaticRecords []string `toml:"records"`
2016-11-13 19:50:44 +07:00
}
// API config
type httpapi struct {
2016-11-17 00:15:36 +07:00
Domain string
Port string
TLS string
TLSCertPrivkey string `toml:"tls_cert_privkey"`
TLSCertFullchain string `toml:"tls_cert_fullchain"`
CorsOrigins []string
2016-11-11 21:48:00 +07:00
}
2016-11-13 19:50:44 +07:00
// Logging config
type logconfig struct {
Level string `toml:"loglevel"`
Logtype string `toml:"logtype"`
File string `toml:"logfile"`
Format string `toml:"logformat"`
}
// The default object
type ACMETxt struct {
Username uuid.UUID
Password string
ACMETxtPost
LastActive time.Time
}
type ACMETxtPost struct {
Subdomain string `json:"subdomain"`
Value string `json:"txt"`
}