journal

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package journal provides a writer that uses a journal file to aide in recovery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File is a writable file that will update a Journal as it closed.

func NewFile

func NewFile(_ context.Context, f writerFile, j *Journal) (*File, error)

NewFile wraps the provided writable file in a journaled File. When the file is closed, the journal will be written to.

func (*File) Close

func (f *File) Close() error

Close closes the underlying file, writing to the journal prior to and after closing.

type Journal

type Journal struct {
	io.Writer
}

Journal is used to record meta data about the operations that will be and have been performed on bsr containers and files. This can be used to aide in recovery if a system crashes while writing a bsr.

func New

func New(_ context.Context, w io.Writer) (*Journal, error)

New creates a Journal that is written to the provided io.Writer.

func (*Journal) Close

func (j *Journal) Close() error

Close optionally closes the underlying io.Writer if it also implements io.Closer.

func (*Journal) Record

func (j *Journal) Record(op, f string) error

Record writes the entry to the journal.

Jump to

Keyboard shortcuts

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