aof

package
v0.0.0-...-fbbe109 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2016 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const MinRotateCompress = 0.7
View Source
const MinSyncPeriod = 100 * time.Millisecond
View Source
const Perm = 0664 // TODO make configurable.

Variables

This section is empty.

Functions

func RotateFile

func RotateFile(rot Rotator, fname string, limit int64, w io.Writer) (err error)

RotateFile rotates fname file prefix size of limit into w.

Types

type AOF

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

AOF represents Append Only File.

func Open

func Open(log log.Logger, r Rotator, conf Config) (aof *AOF, err error)

func (*AOF) Close

func (f *AOF) Close() error

func (*AOF) NewTransaction

func (f *AOF) NewTransaction() io.WriteCloser

NewTransaction create new AOF transaction. Returned transaction hold AOF lock until close, so callee should write data and close it, as soon as possible.

type Config

type Config struct {
	Name       string
	Sync       time.Duration
	RotateSize int64 // AOF size, after which Rotator will be called.
	BufSize    int   // 0 if no buffering.
}

type ROFile

type ROFile interface {
	io.Reader
}

type Rotator

type Rotator interface {
	Rotate(r ROFile, w io.Writer) error
}

type RotatorFunc

type RotatorFunc func(r ROFile, w io.Writer) error

func (RotatorFunc) Rotate

func (f RotatorFunc) Rotate(r ROFile, w io.Writer) error

Jump to

Keyboard shortcuts

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