binlog

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinNormalSeq = uint64(1000000000000000000)
)

Variables

View Source
var (
	ErrLogMissing = errors.New("log file missing")
	ErrUnexpected = errors.New("unexpected binlog reader error")
)

Functions

This section is empty.

Types

type BinLog

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

func NewBinLog

func NewBinLog(dir string, memSize, keepNum int) *BinLog

func (*BinLog) AddRequest

func (bin *BinLog) AddRequest(req *Request)

func (*BinLog) AsMaster

func (bin *BinLog) AsMaster()

func (*BinLog) AsSlave

func (bin *BinLog) AsSlave()

func (*BinLog) Close

func (bin *BinLog) Close()

func (*BinLog) Flush

func (bin *BinLog) Flush()

func (*BinLog) GetBinFileName

func (bin *BinLog) GetBinFileName(fileIdx uint64) string

func (*BinLog) GetLogSeqChanLen

func (bin *BinLog) GetLogSeqChanLen() (uint64, int)

func (*BinLog) GetMasterSeq

func (bin *BinLog) GetMasterSeq() (masterSeq uint64, valid bool)

Only for master/slave mode

func (*BinLog) GetSeqFileName

func (bin *BinLog) GetSeqFileName(fileIdx uint64) string

func (*BinLog) RegisterMonitor

func (bin *BinLog) RegisterMonitor(m Monitor)

func (*BinLog) RemoveMonitor

func (bin *BinLog) RemoveMonitor(m Monitor)

type Monitor

type Monitor interface {
	// NewLogComming tells the monitor there is new binlog written.
	NewLogComming()
}

Monitor is a BinLog monitor.

type Reader

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

func NewReader

func NewReader(bin *BinLog) *Reader

func (*Reader) Close

func (r *Reader) Close()

func (*Reader) Init

func (r *Reader) Init(lastSeq uint64) error

func (*Reader) Next

func (r *Reader) Next() []byte

type Request

type Request struct {
	MasterSeq uint64
	Pkg       []byte
}

Jump to

Keyboard shortcuts

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