storage

package
v0.0.0-...-970995c Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltStorage

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

func NewBoltStorage

func NewBoltStorage(config StorageConfig) (*BoltStorage, error)

func (*BoltStorage) Close

func (s *BoltStorage) Close() error

func (*BoltStorage) FlushCache

func (s *BoltStorage) FlushCache() error

func (*BoltStorage) GetCacheSize

func (s *BoltStorage) GetCacheSize() int64

func (*BoltStorage) GetContentSince

func (s *BoltStorage) GetContentSince(since time.Time) ([]*types.ClipboardContent, error)

func (*BoltStorage) GetLatestContent

func (s *BoltStorage) GetLatestContent() (*types.ClipboardContent, error)

func (*BoltStorage) PublishCacheHistory

func (s *BoltStorage) PublishCacheHistory(since time.Time) error

func (*BoltStorage) SaveContent

func (s *BoltStorage) SaveContent(content *types.ClipboardContent) error

type BoltStorageInterface

type BoltStorageInterface interface {
	SaveContent(content *types.ClipboardContent) error
	GetLatestContent() (*types.ClipboardContent, error)
	GetContentSince(since time.Time) ([]*types.ClipboardContent, error)
	Close() error
	GetCacheSize() int64
	FlushCache() error
}

BoltStorageInterface defines the methods for BoltStorage

type CacheMessage

type CacheMessage struct {
	DeviceID  string
	Contents  []*types.ClipboardContent
	Timestamp time.Time
}

CacheMessage represents a collection of clipboard contents to be published

type StorageConfig

type StorageConfig struct {
	DBPath     string
	MaxSize    int64
	DeviceID   string
	Logger     *utils.Logger
	MQTTClient *broker.MQTTClient
}

Jump to

Keyboard shortcuts

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