Documentation ¶
Index ¶
Constants ¶
View Source
const (
NewLine byte = '\n'
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Indexer ¶
func NewIndexer ¶
type Log ¶
type Log struct { Timestamp time.Time Level LogLevel TimestampFormat LogTimeFormat Message []byte }
Message is an abstraction of log message
func NewLog ¶
func NewLog(msg []byte, logLevel LogLevel, timestampFormat LogTimeFormat) *Log
NewLog wraps the message with log formatted message
type LogTimeFormat ¶
type LogTimeFormat string
const ( LogTimeFormatLocalTime LogTimeFormat = "[Jan 2 2006 15:04:05]" LogTimeFormatUTC LogTimeFormat = "[2006-01-02T15:04:05Z]" )
type Memtable ¶
func NewMemtable ¶
NewMemtable returns a new instance of Memtable
type SegmentFile ¶
type SegmentFile struct { Name string StartTimeStamp int64 LogDirectory string OccupiedSize int Size int Path string Out io.ReadWriteCloser }
func NewSegmentFile ¶
func NewSegmentFile(logDirectory string, startTimeStamp int64, size int) (*SegmentFile, error)
func (*SegmentFile) Close ¶
func (s *SegmentFile) Close() error
func (*SegmentFile) Reader ¶
func (s *SegmentFile) Reader() io.Reader
func (*SegmentFile) Writer ¶
func (s *SegmentFile) Writer() io.Writer
type Writer ¶
type Writer interface { // Write reads from r and writes it to out Write(r io.Reader) (n int, err error) //SetLogLevel sets the given logLevel SetLogLevel(logLevel LogLevel) //SetLogTimeFormat overrides the logTimeFormat // default logTimeFormat is Local Time SetLogTimeFormat(logTimeFormat LogTimeFormat) Replay() error // Close closes flushes the running memtable // anc closes the writer Close() error }
Writer provides an interface to write logs to desired target store
Source Files ¶
Click to show internal directories.
Click to hide internal directories.