Documentation ¶
Index ¶
- func GetLastIndex(dir string) (index uint64, err error)
- func LogPath(dir string) string
- func MockKVPairs(kvPairs ...string) []*iavl.KVPair
- type Config
- type Message
- type Stream
- func (stream *Stream) CheckError() error
- func (stream *Stream) Close() error
- func (stream *Stream) FirstOffset() (index uint64, err error)
- func (stream *Stream) LastOffset() (index uint64, err error)
- func (stream *Stream) ReadAt(index uint64) (*proto.ChangelogEntry, error)
- func (stream *Stream) Replay(start uint64, end uint64, ...) error
- func (stream *Stream) TruncateAfter(index uint64) error
- func (stream *Stream) TruncateBefore(index uint64) error
- func (stream *Stream) Write(offset uint64, entry proto.ChangelogEntry) error
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLastIndex ¶
GetLastIndex returns the last written index of the replay log
func MockKVPairs ¶
Types ¶
type Message ¶
type Message struct { Index uint64 Data *proto.ChangelogEntry }
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func (*Stream) CheckError ¶
CheckError check if there's any failed async writes or not
func (*Stream) FirstOffset ¶
func (*Stream) LastOffset ¶
LastOffset returns the last written offset/index of the log
func (*Stream) ReadAt ¶
func (stream *Stream) ReadAt(index uint64) (*proto.ChangelogEntry, error)
ReadAt will read the log entry at the provided index
func (*Stream) Replay ¶
func (stream *Stream) Replay(start uint64, end uint64, processFn func(index uint64, entry proto.ChangelogEntry) error) error
Replay will read the replay log and process each log entry with the provided function
func (*Stream) TruncateAfter ¶
TruncateAfter will remove all entries that are after the provided `index`. In other words the entry at `index` becomes the last entry in the log.
func (*Stream) TruncateBefore ¶
TruncateBefore will remove all entries that are before the provided `index`. In other words the entry at `index` becomes the first entry in the log.
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func NewSubscriber ¶
func NewSubscriber( maxPendingSize int, processFn func(entry proto.ChangelogEntry) error, ) *Subscriber
func (*Subscriber) CheckError ¶
func (s *Subscriber) CheckError() error
func (*Subscriber) Close ¶
func (s *Subscriber) Close() error
func (*Subscriber) ProcessEntry ¶
func (s *Subscriber) ProcessEntry(entry proto.ChangelogEntry) error
func (*Subscriber) Start ¶
func (s *Subscriber) Start()
Click to show internal directories.
Click to hide internal directories.