Versions in this module Expand all Collapse all v0 v0.1.4 Mar 31, 2021 Changes in this version + const MaxPayloadSize + const MaxRecordSize + var DefaultConfig = Config + var DefaultOptions = Options + var ErrBadVersion = errors.New("log: bad version") + var ErrClosed = errors.New("log: closed") + var ErrCorrupt = errors.New("log: corrupt") + var ErrExist = errors.New("log: already exists") + var ErrLagging = errors.New("log: lagging") + var ErrLocked = errors.New("log: locked") + var ErrNotExist = errors.New("log: does not exist") + var ErrOrphaned = errors.New("log: orphaned") + var ErrOutOfRange = errors.New("log: out of range") + var ErrRecordTooLarge = errors.New("log: record too large") + var ErrTimeout = errors.New("log: timeout") + func Delete(path string) (err error) + func Restore(path string, r io.Reader) (err error) + func Scan(path string) (err error) + func Truncate(path string) (err error) + type Config struct + IndexAfterSize int64 + LogMaxAge int64 + LogMaxCount int64 + LogMaxSize int64 + MaxRecordSize int + SegmentMaxAge int64 + SegmentMaxCount int64 + SegmentMaxSize int64 + type Fanin struct + func NewFanin(lw *LogWriter) (f *Fanin) + func (f *Fanin) Close() (err error) + func (f *Fanin) Flush() (err error) + func (f *Fanin) Write(r *Record) (n int, err error) + type FaninWriter struct + func NewFaninWriter(f *Fanin, ioMode recio.IOMode) (fw *FaninWriter) + func (fw *FaninWriter) Close() (err error) + func (fw *FaninWriter) Flush() (err error) + func (fw *FaninWriter) HandleSync(h SyncHandler) + func (fw *FaninWriter) Write(r *Record) (n int, err error) + type Log struct + func Create(path string, config Config, options Options) (l *Log, err error) + func Open(path string, options Options) (l *Log, err error) + func (l *Log) Backup(w io.Writer) (err error) + func (l *Log) Close() (err error) + func (l *Log) NewReader(bufferSize int, follow bool, ioMode recio.IOMode) (lr *LogReader, err error) + func (l *Log) NewWriter(bufferSize int, ioMode recio.IOMode) (lw *LogWriter, err error) + func (l *Log) Stat() (stat Stat) + func (l *Log) Subscribe(subscriber chan Stat) + func (l *Log) Unsubscribe(subscriber chan Stat) + type LogReader struct + func (lr *LogReader) Close() (err error) + func (lr *LogReader) Fill() (err error) + func (lr *LogReader) Read(r *Record) (n int, err error) + func (lr *LogReader) Seek(position int64, whence Whence) (err error) + func (lr *LogReader) SetWaitDeadline(t time.Time) (err error) + func (lr *LogReader) Tell() (position int64, offset int64) + type LogWriter struct + func (lw *LogWriter) Close() (err error) + func (lw *LogWriter) Flush() (err error) + func (lw *LogWriter) HandleSync(h SyncHandler) + func (lw *LogWriter) Tell() (position int64, offset int64) + func (lw *LogWriter) Write(r *Record) (n int, err error) + type Options struct + SyncLock sync.Mutex + type Record []byte + func (r *Record) Decode(p []byte) (n int, err error) + func (r *Record) Encode(p []byte) (n int, err error) + func (r *Record) Size() (size int) + type Stat struct + EndOffset int64 + EndPosition int64 + StartOffset int64 + StartPosition int64 + StartTimestamp int64 + type SyncHandler func(syncProgress SyncProgress) + type SyncProgress struct + Count int64 + Position int64 + type Whence string + const SeekCurrent + const SeekEnd + const SeekOrigin + const SeekStart