Documentation
¶
Index ¶
- func Bool(key string) (bool, error)
- func DefaultPaths() []string
- func DefaultString(key, defaultValue string) string
- func Int(key string) (int, error)
- func Int64(key string) (int64, error)
- func IsSupportedConfigPath(path string) bool
- func Load(path string) error
- func LoadCandidates(paths ...string) error
- func LoadDefault() error
- func Path() string
- func RegisterFormat(format string, parser parserFunc, extensions ...string) error
- func RegisterViperFormat(format string, extensions ...string) error
- func Reload() error
- func SetPreferredPath(path string)
- func String(key string) string
- func SupportedExtensions() []string
- type AppConfig
- type AuthConfig
- type BridgeConfig
- type BridgeDisplayConfig
- type BridgeDisplayEndpoint
- type FeatureConfig
- type LogConfig
- type NetworkConfig
- type P2PConfig
- type ProxyConfig
- type RuntimeConfig
- type SSLConfig
- type SecurityConfig
- type Snapshot
- type WebConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPaths ¶
func DefaultPaths() []string
DefaultPaths returns the candidate nps server config paths in load order.
func DefaultString ¶
func IsSupportedConfigPath ¶
IsSupportedConfigPath reports whether the file extension maps to a registered parser.
func LoadCandidates ¶
LoadCandidates loads the first readable config file from the provided paths.
func LoadDefault ¶
func LoadDefault() error
LoadDefault loads the server config from the default candidate paths.
func RegisterFormat ¶
RegisterFormat registers a parser for one or more file extensions.
func RegisterViperFormat ¶
RegisterViperFormat registers a new config format backed by Viper.
func Reload ¶
func Reload() error
Reload reloads the currently loaded config file. If no config has been loaded yet, it falls back to the default candidate paths.
func SetPreferredPath ¶
func SetPreferredPath(path string)
SetPreferredPath configures an explicit config file path to try before defaults.
func SupportedExtensions ¶
func SupportedExtensions() []string
SupportedExtensions returns all registered config file extensions.
Types ¶
type AuthConfig ¶
type BridgeConfig ¶
type BridgeConfig struct {
Addr string
Type string
PrimaryType string
SelectMode string
CertFile string
KeyFile string
TCPEnable bool
KCPEnable bool
QUICEnable bool
TLSEnable bool
WSEnable bool
WSSEnable bool
ServerTCPEnabled bool
ServerKCPEnabled bool
ServerQUICEnabled bool
ServerTLSEnabled bool
ServerWSEnabled bool
ServerWSSEnabled bool
Display BridgeDisplayConfig
}
type BridgeDisplayConfig ¶
type BridgeDisplayConfig struct {
Path string
TCP BridgeDisplayEndpoint
KCP BridgeDisplayEndpoint
QUIC BridgeDisplayEndpoint
TLS BridgeDisplayEndpoint
WS BridgeDisplayEndpoint
WSS BridgeDisplayEndpoint
}
type BridgeDisplayEndpoint ¶
type FeatureConfig ¶
type FeatureConfig struct {
AllowUserLogin bool
AllowUserRegister bool
AllowUserVkeyLogin bool
AllowUserChangeUsername bool
OpenCaptcha bool
AllowFlowLimit bool
AllowRateLimit bool
AllowTimeLimit bool
AllowConnectionNumLimit bool
AllowMultiIP bool
AllowTunnelNumLimit bool
AllowLocalProxy bool
AllowUserLocal bool
AllowSecretLink bool
AllowSecretLocal bool
SystemInfoDisplay bool
AllowPorts string
}
type NetworkConfig ¶
type NetworkConfig struct {
BridgeIP string
BridgeHost string
BridgeTCPIP string
BridgeKCPIP string
BridgeQUICIP string
BridgeTLSIP string
BridgeWSIP string
BridgeWSSIP string
BridgePort int
BridgeTCPPort int
BridgeKCPPort int
BridgeQUICPort int
BridgeTLSPort int
BridgeWSPort int
BridgeWSSPort int
BridgePath string
BridgeTrustedIPs string
BridgeRealIPHeader string
HTTPProxyIP string
HTTPProxyPort int
HTTPSProxyPort int
HTTP3ProxyPort int
WebIP string
WebPort int
P2PIP string
P2PPort int
QUICALPN string
QUICALPNList []string
QUICKeepAlivePeriod int
QUICMaxIdleTimeout int
QUICMaxIncomingStreams int64
MuxPingInterval int
}
type ProxyConfig ¶
type RuntimeConfig ¶
type SecurityConfig ¶
type Snapshot ¶
type Snapshot struct {
App AppConfig
Log LogConfig
Web WebConfig
Auth AuthConfig
Feature FeatureConfig
Security SecurityConfig
Runtime RuntimeConfig
Network NetworkConfig
Bridge BridgeConfig
Proxy ProxyConfig
P2P P2PConfig
}