log

package
v0.0.0-...-5263468 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Segment struct {
		MaxIndexBytes uint64
		MaxStoreBytes uint64
		InitialOffset uint64
	}
}

type Log

type Log struct {
	Dir    string
	Config Config
	// contains filtered or unexported fields
}

func NewLog

func NewLog(dir string, c Config) (*Log, error)

NewLog creates a new log based on given config in the given directory.

func (*Log) Append

func (l *Log) Append(record *api.Record) (off uint64, err error)

Append adds new record to the log and return its offset value.

func (*Log) Close

func (l *Log) Close() error

Close closes the log and its segments.

func (*Log) Read

func (l *Log) Read(off uint64) (*api.Record, error)

Read reads the record stored at the given offset.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL