Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogManager ¶
LogManager provides writers the ability to track offsets associated with processed messages.
func NewLogManager ¶
func NewLogManager(path, name string) (*LogManager, error)
NewLogManager creates a new instance of LogManager and initializes its namespace map by reading any existing log files.
func (*LogManager) CommitOffset ¶
func (m *LogManager) CommitOffset(o Offset, override bool) error
CommitOffset verifies it does not contain an offset older than the current offset and persists to the log.
func (*LogManager) NewestOffset ¶
func (m *LogManager) NewestOffset() int64
NewestOffset loops over every offset and returns the highest one.
func (*LogManager) OffsetMap ¶
func (m *LogManager) OffsetMap() map[string]uint64
OffsetMap provides access to the underlying map containing the newest offset for every namespace.
type Manager ¶
type Manager interface { CommitOffset(Offset, bool) error OffsetMap() map[string]uint64 NewestOffset() int64 }
Manager defines the necessary functions for providing the ability to manage offsets associated with a commitlog.CommitLog.
type MockManager ¶
type MockManager struct { MemoryMap map[string]uint64 CommitDelay time.Duration CommitErr error sync.Mutex }
MockManager implements offset.Manager for use in tests.
func (*MockManager) CommitOffset ¶
func (m *MockManager) CommitOffset(o Offset, override bool) error
CommitOffset satisfies offset.Manager interface.
func (*MockManager) NewestOffset ¶
func (m *MockManager) NewestOffset() int64
NewestOffset satisfies offset.Manager interface.
func (*MockManager) OffsetMap ¶
func (m *MockManager) OffsetMap() map[string]uint64
OffsetMap satisfies offset.Manager interface.