Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Chars = [...]string{ log.DebugLevel: "D", log.InfoLevel: "I", log.WarnLevel: "W", log.ErrorLevel: "E", log.FatalLevel: "F", }
Chars mapping.
var Colors = [...]int{ log.DebugLevel: gray, log.InfoLevel: blue, log.WarnLevel: yellow, log.ErrorLevel: red, log.FatalLevel: red, }
Colors mapping.
var ErrScheduleTimeout = fmt.Errorf("schedule error: timed out")
ErrScheduleTimeout returned by Pool to indicate that there no free goroutines during some period of time.
var Strings = [...]string{ log.DebugLevel: "DEBUG", log.InfoLevel: "INFO", log.WarnLevel: "WARN", log.ErrorLevel: "ERROR", log.FatalLevel: "FATAL", }
Strings mapping.
Functions ¶
func InitLogger ¶
InitLogger sets log level, format and output
func OpenFileLimit ¶ added in v0.6.3
func OpenFileLimit() (limitStr string)
OpenFileLimit returns a string displaying the current open file limit for the process or unknown if it's not possible to detect it
Types ¶
type GoPool ¶ added in v1.1.0
type GoPool struct {
// contains filtered or unexported fields
}
GoPool contains logic of goroutine reuse. Copied from https://github.com/gobwas/ws-examples/blob/master/src/gopool/pool.go
func NewGoPool ¶ added in v1.1.0
NewGoPool creates new goroutine pool with given size. Start size defaults to 20% of the max size but not greater than 1024. Queue size defaults to 50% of the max size.
func (*GoPool) Schedule ¶ added in v1.1.0
func (p *GoPool) Schedule(task func())
Schedule schedules task to be executed over pool's workers.
func (*GoPool) ScheduleTimeout ¶ added in v1.1.0
ScheduleTimeout schedules task to be executed over pool's workers. It returns ErrScheduleTimeout when no free workers met during given timeout.
type LogHandler ¶
type LogHandler struct {
// contains filtered or unexported fields
}
LogHandler with TTY awareness
type MessageVerifier ¶ added in v1.2.0
type MessageVerifier struct {
// contains filtered or unexported fields
}
func NewMessageVerifier ¶ added in v1.2.0
func NewMessageVerifier(key string) *MessageVerifier