storages

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dump

type Dump struct {
	Filename        string
	FlushFunc       func()
	Deserialize     func([]byte)
	OnFlushComplete func()
	FlushDelay      time.Duration
	IsFlushing      bool
	Logger          *zap.SugaredLogger
}

func NewDump

func NewDump(lg *zap.SugaredLogger, filename string, flushDelay time.Duration, flushFunc func(), onFlushComplete func()) *Dump

func (*Dump) Flush

func (d *Dump) Flush(version int64, data interface{})

func (*Dump) ForceFlush

func (d *Dump) ForceFlush()

func (*Dump) Recover

func (d *Dump) Recover(version *int64, dataDst interface{}) error

func (*Dump) StartFlushThread

func (d *Dump) StartFlushThread()

type WAL

type WAL struct {
	File     *os.File
	Filename string
	OnDecode func(reader io.Reader)
	Logger   *zap.SugaredLogger
}

func NewWAL

func NewWAL(lg *zap.SugaredLogger, filename string, onDecode func(io.Reader)) *WAL

func (*WAL) Recover

func (w *WAL) Recover()

func (*WAL) Recreate

func (w *WAL) Recreate()

func (*WAL) Write

func (w *WAL) Write(serializedEvent []byte)

Jump to

Keyboard shortcuts

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