storage

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryStorage

type InMemoryStorage struct {
	Storage
	// contains filtered or unexported fields
}

func (*InMemoryStorage) EvictMessages

func (s *InMemoryStorage) EvictMessages(topic string, partition models.Partition, ttl time.Duration) error

func (*InMemoryStorage) GetMessages

func (s *InMemoryStorage) GetMessages(topic string, partition models.Partition) (models.MessageList, error)

func (*InMemoryStorage) StoreMessage

func (s *InMemoryStorage) StoreMessage(msg *models.Message) error

type Storage

type Storage interface {
	StoreMessage(msg *models.Message) error
	GetMessages(topic string, partition models.Partition) (models.MessageList, error)
	EvictMessages(topic string, partition models.Partition, ttl time.Duration) error
}

Storage defines methods to be implemented by each storage backend.

func GetStorage

func GetStorage(config *models.BrokerConfig) Storage

func NewInMemoryStorage

func NewInMemoryStorage() Storage

Jump to

Keyboard shortcuts

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