hnakra/router/config/config.go
2023-05-26 01:18:16 -04:00

35 lines
808 B
Go

// Config provides a configuration system for routers.
package config
import "crypto/tls"
// Config is an interface that configuration objects must fulfill.
type Config interface {
User (name string) User
OverUsers (func (name string, user User) bool)
RconEnable () bool
RouterPort () int
HTTPSPort () int
HTTPSEnable () bool
HTTPPort () int
HTTPEnable () bool
GeminiPort () int
GeminiEnable () bool
Certificate () tls.Certificate
ResolveAlias (alias string) string
AliasFallback () string
OverAliases (func (alias, target string) bool)
}
// User represents a Hnakra user.
type User interface {
Validate (key []byte) bool
RconAllow () bool
OverPatterns (func (pattern string) bool)
CanMountOn (scheme, host, path string) bool
}