store

package
v0.0.0-...-fdc8e6b Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Unlicense Imports: 3 Imported by: 0

Documentation

Overview

Implement expiry within the the actual value storage The underlying store will need to use this when Inserting/Retrieving

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasBytesExpired

func HasBytesExpired(buf []byte, now time.Time) bool

Types

type StoreEntry

type StoreEntry struct {
	Value []byte
	expiry.ExpiryRecord
}

StoreEntry retains the efficiency of ExpiryRecord Further encodes the expiry in the the Value

func DecodeStoreEntry

func DecodeStoreEntry(key, value []byte) StoreEntry

Decode the raw bytes into the StoreEntry type

func (*StoreEntry) Encode

func (e *StoreEntry) Encode() (key, value []byte)

type StoreExpiry

type StoreExpiry struct {
	*expiry.Expiry
}

func NewStoreExpiry

func NewStoreExpiry(compactorFunc func(), compactionInterval time.Duration) (*StoreExpiry, error)

func (*StoreExpiry) NewStoreEntry

func (s *StoreExpiry) NewStoreEntry(key string, value []byte, ttl time.Duration) StoreEntry

Jump to

Keyboard shortcuts

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