Documentation
¶
Index ¶
- Constants
- Variables
- func DNSDefaultRecords(origin string, ip net.IP) *dnsx.Records
- func DNSHandler(cfg *DNSConfig, db *database.DB, tel telemetry.Telemetry, origin string, ...) dnsx.HandlerProvider
- func DNSTelemetryHandler(tel telemetry.Telemetry, next dnsx.Handler) dnsx.Handler
- func DNSZoneFileRecords(filePath, origin string, ip net.IP) *dnsx.Records
- func FTPHandler(domain string, log *slog.Logger, tel telemetry.Telemetry, ...) netx.Handler
- func FTPListenerWrapper(maxBytes int64, idleTimeout time.Duration) func(net.Listener) net.Listener
- func FTPTelemetry(next netx.Handler, tel telemetry.Telemetry) netx.Handler
- func HTTPDefault(w http.ResponseWriter, r *http.Request)
- func HTTPHandler(db *database.DB, tel telemetry.Telemetry, origin string, ...) http.Handler
- func HTTPTelemetry(next http.Handler, tel telemetry.Telemetry) http.Handler
- func Run(ctx context.Context, stdout io.Writer, stderr io.Writer, dir fs.FS, ...) error
- func SMTPHandler(domain string, log *slog.Logger, tel telemetry.Telemetry, ...) netx.Handler
- func SMTPListenerWrapper(maxBytes int64, idleTimeout time.Duration) func(net.Listener) net.Listener
- func SMTPTelemetry(next netx.Handler, tel telemetry.Telemetry) netx.Handler
- type AuditConfig
- type Config
- type Controller
- type DBConfig
- type DNSConfig
- type EventsHandler
- type GeoIPConfig
- type ModulesConfig
- type NotifyFunc
- type TLS
- type TLSConfig
- type TLSCustomConfig
- type TLSLetsEncryptConfig
- type TelemetryConfig
Constants ¶
View Source
const ConfigFileName = "config.toml"
Variables ¶
View Source
var ConfigDefaults = map[string]any{
"tls.type": "letsencrypt",
"tls.letsencrypt.directory": "./tls",
"tls.letsencrypt.ca_dir_url": "https://acme-v02.api.letsencrypt.org/directory",
"modules.enabled": "api",
"modules.api.port": 31337,
}
Functions ¶
func DNSHandler ¶
func DNSTelemetryHandler ¶
func FTPHandler ¶
func FTPListenerWrapper ¶
func HTTPDefault ¶
func HTTPDefault(w http.ResponseWriter, r *http.Request)
func HTTPHandler ¶
func SMTPHandler ¶
func SMTPListenerWrapper ¶
Types ¶
type AuditConfig ¶
type AuditConfig struct {
Enabled bool
}
func (AuditConfig) Validate ¶
func (c AuditConfig) Validate() error
type Config ¶
type Config struct {
Domain string
IP string
GeoIP GeoIPConfig
DB DBConfig
Audit AuditConfig
DNS DNSConfig
TLS TLSConfig
Telemetry TelemetryConfig
Modules ModulesConfig
}
type Controller ¶
type Controller interface {
Start() error
}
type EventsHandler ¶
type EventsHandler struct {
// contains filtered or unexported fields
}
func NewEventsHandler ¶
func (*EventsHandler) AddNotifier ¶
func (h *EventsHandler) AddNotifier(name string, notifier modules.Notifier)
func (*EventsHandler) Start ¶
func (h *EventsHandler) Start() error
type GeoIPConfig ¶
func (GeoIPConfig) Validate ¶
func (c GeoIPConfig) Validate() error
type ModulesConfig ¶
type ModulesConfig struct {
Enabled []string
// TODO: dynamic modules config (something like json.RawMessage) to be able to not include
// unnecessary modules in binary.
Telegram telegram.Config
API api.Config
Lark lark.Config
Slack slack.Config
}
func (ModulesConfig) Validate ¶
func (c ModulesConfig) Validate() error
type TLSConfig ¶
type TLSConfig struct {
Type string
Custom TLSCustomConfig
LetsEncrypt TLSLetsEncryptConfig
}
type TLSCustomConfig ¶
func (TLSCustomConfig) Validate ¶
func (c TLSCustomConfig) Validate() error
type TLSLetsEncryptConfig ¶
type TLSLetsEncryptConfig struct {
Email string
Directory string
CADirURL string `koanf:"ca_dir_url"`
CAInsecure bool `koanf:"ca_insecure"`
}
func (TLSLetsEncryptConfig) Validate ¶
func (c TLSLetsEncryptConfig) Validate() error
type TelemetryConfig ¶
type TelemetryConfig struct {
Enabled bool
}
func (TelemetryConfig) Validate ¶
func (c TelemetryConfig) Validate() error
Click to show internal directories.
Click to hide internal directories.