2015-09-19 13:35:20 +00:00
|
|
|
package mocks
|
|
|
|
|
|
|
|
import (
|
2015-10-06 21:11:08 +00:00
|
|
|
"github.com/v2ray/v2ray-core/config"
|
2015-09-19 13:35:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type ConnectionConfig struct {
|
|
|
|
ProtocolValue string
|
2015-10-06 21:11:08 +00:00
|
|
|
SettingsValue interface{}
|
2015-09-19 13:35:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (config *ConnectionConfig) Protocol() string {
|
|
|
|
return config.ProtocolValue
|
|
|
|
}
|
|
|
|
|
2015-10-06 21:11:08 +00:00
|
|
|
func (config *ConnectionConfig) Settings(config.Type) interface{} {
|
|
|
|
return config.SettingsValue
|
2015-09-19 13:35:20 +00:00
|
|
|
}
|
|
|
|
|
2015-10-09 15:58:35 +00:00
|
|
|
type LogConfig struct {
|
|
|
|
AccessLogValue string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (config *LogConfig) AccessLog() string {
|
|
|
|
return config.AccessLogValue
|
|
|
|
}
|
|
|
|
|
2015-09-19 13:35:20 +00:00
|
|
|
type Config struct {
|
|
|
|
PortValue uint16
|
2015-10-09 15:58:35 +00:00
|
|
|
LogConfigValue *LogConfig
|
2015-09-19 13:35:20 +00:00
|
|
|
InboundConfigValue *ConnectionConfig
|
|
|
|
OutboundConfigValue *ConnectionConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
func (config *Config) Port() uint16 {
|
|
|
|
return config.PortValue
|
|
|
|
}
|
|
|
|
|
2015-10-09 15:58:35 +00:00
|
|
|
func (config *Config) LogConfig() config.LogConfig {
|
|
|
|
return config.LogConfigValue
|
|
|
|
}
|
|
|
|
|
2015-10-06 21:11:08 +00:00
|
|
|
func (config *Config) InboundConfig() config.ConnectionConfig {
|
2015-09-19 13:35:20 +00:00
|
|
|
return config.InboundConfigValue
|
|
|
|
}
|
|
|
|
|
2015-10-06 21:11:08 +00:00
|
|
|
func (config *Config) OutboundConfig() config.ConnectionConfig {
|
2015-09-19 13:35:20 +00:00
|
|
|
return config.OutboundConfigValue
|
|
|
|
}
|