CovenantSQL: github.com/CovenantSQL/CovenantSQL/kayak/wal Index | Files

package wal

import "github.com/CovenantSQL/CovenantSQL/kayak/wal"

Package wal defines toy implementations of kayak wal.

Index

Package Files

doc.go errors.go leveldb_wal.go mem_wal.go

Variables

var (
    // ErrWalClosed represents the log file is closed.
    ErrWalClosed = errors.New("wal is closed")
    // ErrInvalidLog represents the log object is invalid.
    ErrInvalidLog = errors.New("invalid log")
    // ErrAlreadyExists represents the log already exists.
    ErrAlreadyExists = errors.New("log already exists")
    // ErrNotExists represents the log does not exists.
    ErrNotExists = errors.New("log not exists")
)

type LevelDBWal Uses

type LevelDBWal struct {
    // contains filtered or unexported fields
}

LevelDBWal defines a toy wal using leveldb as storage.

func NewLevelDBWal Uses

func NewLevelDBWal(filename string) (p *LevelDBWal, err error)

NewLevelDBWal returns new leveldb wal instance.

func (*LevelDBWal) Close Uses

func (p *LevelDBWal) Close()

Close implements Wal.Close.

func (*LevelDBWal) Get Uses

func (p *LevelDBWal) Get(i uint64) (l *kt.Log, err error)

Get implements Wal.Get.

func (*LevelDBWal) Read Uses

func (p *LevelDBWal) Read() (l *kt.Log, err error)

Read implements Wal.Read.

func (*LevelDBWal) Write Uses

func (p *LevelDBWal) Write(l *kt.Log) (err error)

Write implements Wal.Write.

type MemWal Uses

type MemWal struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

MemWal defines a toy wal using memory as storage.

func NewMemWal Uses

func NewMemWal() (p *MemWal)

NewMemWal returns new memory wal instance.

func (*MemWal) Close Uses

func (p *MemWal) Close()

Close implements Wal.Close.

func (*MemWal) Get Uses

func (p *MemWal) Get(index uint64) (l *kt.Log, err error)

Get implements Wal.Get.

func (*MemWal) Read Uses

func (p *MemWal) Read() (l *kt.Log, err error)

Read implements Wal.Read.

func (*MemWal) Write Uses

func (p *MemWal) Write(l *kt.Log) (err error)

Write implements Wal.Write.

Package wal imports 12 packages (graph) and is imported by 2 packages. Updated 2019-06-09. Refresh now. Tools for package owners.