Documentation ¶
Overview ¶
Disk-backed queue
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalFileDataStore ¶
type LocalFileDataStore struct {
// contains filtered or unexported fields
}
func NewLocalFileDataStore ¶
func NewLocalFileDataStore(dir, name string) (ds *LocalFileDataStore)
func (*LocalFileDataStore) Destroy ¶
func (ds *LocalFileDataStore) Destroy()
func (*LocalFileDataStore) LastReadAt ¶
func (ds *LocalFileDataStore) LastReadAt() time.Time
func (*LocalFileDataStore) LastWriteAt ¶
func (ds *LocalFileDataStore) LastWriteAt() time.Time
type SingleFileStore ¶
type SingleFileStore struct { // Filename is the file to write logs to. Backup log files will be retained // in the same directory. Filename string Offset int64 // offset at the head of the file Position int64 // offset for current tail, write position // contains filtered or unexported fields }
func (*SingleFileStore) Close ¶
func (l *SingleFileStore) Close() error
Close implements io.Closer, and closes the current logfile.
func (*SingleFileStore) Destroy ¶
func (l *SingleFileStore) Destroy()
func (*SingleFileStore) ReadAt ¶
func (l *SingleFileStore) ReadAt(data []byte, offset int64) (int, error)
func (*SingleFileStore) Write ¶
func (l *SingleFileStore) Write(p []byte) (n int, err error)
Write implements io.Writer. If a write would cause the log file to be larger than MaxMegaByte, the file is closed, renamed to include a timestamp of the current time, and a new log file is created using the original log file name. If the length of the write is greater than MaxMegaByte, an error is returned.
Click to show internal directories.
Click to hide internal directories.