Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAllTargetsOffline = errors.New("all the targets are offline")
Functions ¶
func GetRandomClient ¶
GetRandomClient fetches a random client from the provided list of clients.
func IsContextError ¶
IsContextError returns true if the error relates to context cancel or deadline exceeded.
Types ¶
type FileLogger ¶
type FileLogger struct {
// contains filtered or unexported fields
}
FileLogger logs the messages to a file.
func NewLogger ¶
func NewLogger(file *os.File, verbosity int) *FileLogger
New returns the FileLogger instance.
func (*FileLogger) CurrentV ¶
func (l *FileLogger) CurrentV() int
CurrentV returns the current verbosity level configured.
func (*FileLogger) Log ¶
func (l *FileLogger) Log(message string) error
Log writes the message to the file.
func (*FileLogger) V ¶
func (l *FileLogger) V(v int) Logger
V returns the FileLogger if the verbosity level is less than the configured level. Else, returns a no-op logger.
type NoOpLogger ¶
type NoOpLogger struct{}
NoOpLogger is used for a nil logger.
func (NoOpLogger) CurrentV ¶
func (l NoOpLogger) CurrentV() int
CurrentV for NoOP returns -1 (For interface compatibility).
func (NoOpLogger) V ¶
func (l NoOpLogger) V(v int) Logger
V returns the FileLogger if the verbosity level is less than the configured level. Else, returns a no-op logger.
Click to show internal directories.
Click to hide internal directories.