mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 10:08:15 -05:00
50 lines
978 B
Go
50 lines
978 B
Go
package mocks
|
|
|
|
import (
|
|
"github.com/v2ray/v2ray-core/config"
|
|
)
|
|
|
|
type ConnectionConfig struct {
|
|
ProtocolValue string
|
|
SettingsValue interface{}
|
|
}
|
|
|
|
func (config *ConnectionConfig) Protocol() string {
|
|
return config.ProtocolValue
|
|
}
|
|
|
|
func (config *ConnectionConfig) Settings(config.Type) interface{} {
|
|
return config.SettingsValue
|
|
}
|
|
|
|
type LogConfig struct {
|
|
AccessLogValue string
|
|
}
|
|
|
|
func (config *LogConfig) AccessLog() string {
|
|
return config.AccessLogValue
|
|
}
|
|
|
|
type Config struct {
|
|
PortValue uint16
|
|
LogConfigValue *LogConfig
|
|
InboundConfigValue *ConnectionConfig
|
|
OutboundConfigValue *ConnectionConfig
|
|
}
|
|
|
|
func (config *Config) Port() uint16 {
|
|
return config.PortValue
|
|
}
|
|
|
|
func (config *Config) LogConfig() config.LogConfig {
|
|
return config.LogConfigValue
|
|
}
|
|
|
|
func (config *Config) InboundConfig() config.ConnectionConfig {
|
|
return config.InboundConfigValue
|
|
}
|
|
|
|
func (config *Config) OutboundConfig() config.ConnectionConfig {
|
|
return config.OutboundConfigValue
|
|
}
|