Documentation
¶
Index ¶
Constants ¶
View Source
const ( LogLevelDebug = "debug" LogLevelInformation = "info" LogLevelWarning = "warn" LogLevelError = "error" LogLevelFatal = "fatal" LogLevelPanic = "panic" LogLevelNone = "none" LogLevelDisableLogger = "disabled" LogLevelDefault = LogLevelError )
View Source
const ( HostDefault = "0.0.0.0" PortDefault = 8080 TargetConnectionDialTimeoutSecDefault = 60 MustDecodeGzipDefault = false MustRemoveBOMDefault = true MustUseSpeedLimiterDefault = true // SpeedLimiterNormalLimitBytesPerSecDefault is a default value of a normal // (average) speed limit in bytes per second. // Golang's 'io' package in Go version 1.20.2 uses 32 KiB chunks for // reading with io.Copy. It means that this parameter should not be less // than 32 KiB which is 32'768 b/s. Also note that in future versions of // Go language this behaviour may change. SpeedLimiterNormalLimitBytesPerSecDefault = 50_000 // 50 kByte/s. // SpeedLimiterBurstLimitBytesPerSecDefault is a default value of a burst // (short-term) speed limit in bytes per second. // Golang's 'io' package in Go version 1.20.2 uses 32 KiB chunks for // reading with io.Copy. It means that this parameter should not be less // than 32 KiB which is 32'768 b/s. Also note that in future versions of // Go language this behaviour may change. SpeedLimiterBurstLimitBytesPerSecDefault = 50_000 // 50 kByte/s. // SpeedLimiterMaxBNRDefault is a default value of maximal normal-to-burst // ratio (coefficient). SpeedLimiterMaxBNRDefault = 2.0 )
View Source
const BCST = time.Millisecond * 50
Variables ¶
This section is empty.
Functions ¶
func SetLogLevel ¶
func SetLogLevel(logLevelParameter string)
Types ¶
type LogLevelSetting ¶
type Parameters ¶
type Parameters struct { LogLevel string Host string Port uint16 // Content. MustDecodeGzip bool MustRemoveBOM bool MustUseSpeedLimiter bool SpeedLimiterNormalLimitBytesPerSec float64 SpeedLimiterBurstLimitBytesPerSec int SpeedLimiterMaxBNR float64 // Timeouts. TargetConnectionDialTimeoutSec uint // Work mode. WorkModeString string WorkModeList string // contains filtered or unexported fields }
func ReadParameters ¶
func ReadParameters() (p *Parameters, err error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(p *Parameters) (srv *Server, err error)
func (*Server) GetListenDsn ¶
func (*Server) GetStopChannel ¶
Click to show internal directories.
Click to hide internal directories.