Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetVariantLength ¶
GetVariantLength returns the length of variant-encoded-bytes.
Types ¶
type BufioReader ¶
type BufioReader interface { // Read reads a new entry's content. Read() (content []byte, err error) // Next reads from Reader and records the content and error. // returns true if not exceed the end of file. // returns false means there is no more data can be read from the reader. Next() bool // Reset switches the buffered reader to read from a new file: // open the new file; close the old opening file; // discards any buffered data and reset the states of bufio.Reader // reset the content-buffer and count. Reset(fileName string) error // Count returns the total size of bytes read successfully, including length cost. Count() int64 // Size returns the total size of the file. Size() (int64, error) // Close closes the underlying file. Close() error }
BufioReader read entries from a specified file by buffered I/O. Not thread-safe
func NewBufioReader ¶
func NewBufioReader(fileName string) (BufioReader, error)
NewBufioReader returns a new BufioReader from fileName.
type BufioWriter ¶
type BufioWriter interface { // Write writes a new entry containing logs in order. // Close syncs data to disk, then closes the opened file. io.WriteCloser // Reset switches the buffered writer to write to a new file: // open the new file; close the old opening file; // discards any buffered data and reset the states of bufio.Writer Reset(fileName string) error // Sync flushes data first, then calls syscall.sync. Sync() error // Flush flushes data to io.Writer. Flush() error // Size returns the length of written data. Size() int64 }
BufioWriter writes entries to a specified file by buffered I/O. Not thread-safe.
func NewBufioWriter ¶
func NewBufioWriter(fileName string) (BufioWriter, error)
NewBufioWriter returns a new BufioWriter from fileName.
Click to show internal directories.
Click to hide internal directories.