Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlushInterval ¶
FlushInterval creates a time.Timer to fire after the given time.Duration d, to call logger.Flush(). If logger.Flush() returns a non-nil error, the onError function is called, with the non-nil error as an argument.
If the non-nil error returned from logger.Flush() is wal.ErrLoggerClosed, this function will exit. It is recommended to call this function in its own goroutine.
logger, err := wal.NewLogger(NewDirectorySink("/tmp/wal.d")) if err != nil { ... } go FlushInterval(logger, 10*time.Second, func(err error) { log.Println("error flushing wal:", err) })
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.