hnakra/router/config/config.go

35 lines
808 B
Go
Raw Normal View History

// Config provides a configuration system for routers.
2023-05-25 16:08:56 -06:00
package config
import "crypto/tls"
// Config is an interface that configuration objects must fulfill.
2023-05-25 16:08:56 -06:00
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.
2023-05-25 16:08:56 -06:00
type User interface {
Validate (key []byte) bool
RconAllow () bool
OverPatterns (func (pattern string) bool)
CanMountOn (scheme, host, path string) bool
}