database

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBDriver

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

func NewDBDriver

func NewDBDriver(db_path string) (*DBDriver, error)

func (*DBDriver) AddMessageToTopic

func (d *DBDriver) AddMessageToTopic(topic string, data []byte) error

func (*DBDriver) Close

func (d *DBDriver) Close()

func (*DBDriver) CreateTopic

func (d *DBDriver) CreateTopic(topic string) error

func (*DBDriver) Debug

func (d *DBDriver) Debug()

func (*DBDriver) Debug2

func (d *DBDriver) Debug2()

func (*DBDriver) DeleteMessagesUntilOffset

func (d *DBDriver) DeleteMessagesUntilOffset(topic string, offset int64) error

func (*DBDriver) DeleteTopic

func (d *DBDriver) DeleteTopic(topic string) error

func (*DBDriver) GetEarliestMessageFromTopic

func (d *DBDriver) GetEarliestMessageFromTopic(topic string) ([]byte, int64, error)

func (*DBDriver) GetEarliestOffset

func (d *DBDriver) GetEarliestOffset(topic string) (int64, error)

func (*DBDriver) GetLatestMessageFromTopic

func (d *DBDriver) GetLatestMessageFromTopic(topic string) ([]byte, int64, error)

func (*DBDriver) GetLatestOffset

func (d *DBDriver) GetLatestOffset(topic string) (int64, error)

func (*DBDriver) GetMessageAtOffset

func (d *DBDriver) GetMessageAtOffset(topic string, offset int64) ([]byte, error)

func (*DBDriver) GetMessagesAfterOffsetWithLimit added in v1.0.2

func (d *DBDriver) GetMessagesAfterOffsetWithLimit(topic string, startOffset int64, limit int) ([]Message, int64, error)

type DBDriverInterface

type DBDriverInterface interface {
	CreateTopic(topic string) error
	AddMessageToTopic(topic string, data []byte) error
	GetMessageAtOffset(topic string, offset int64) ([]byte, error)
	GetEarliestOffset(topic string) (int64, error)
	GetLatestOffset(topic string) (int64, error)
	GetEarliestMessageFromTopic(topic string) ([]byte, int64, error)
	GetLatestMessageFromTopic(topic string) ([]byte, int64, error)
	GetMessagesAfterOffsetWithLimit(topic string, startOffset int64, limit int) ([]Message, int64, error)
	DeleteMessagesUntilOffset(topic string, offset int64) error
	Close()
	Debug()
}

DBDriverInterface defines the interface for database operations

type Message added in v1.0.2

type Message struct {
	Message []byte
	Offset  int64
}

Message represents a message retrieved from the database, including its content and offset.

type Topic

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

Jump to

Keyboard shortcuts

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