store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteWithKey added in v0.1.0

func DeleteWithKey[K comparable](key K) bool

DeleteWithKey removes a key

func Get added in v0.1.0

func Get[K comparable, V any](key K) (V, bool)

Get retrieves a value with type inference

func Set added in v0.1.0

func Set[K comparable, V any](key K, value V, ttl time.Time)

Set stores a value with TTL

Types

type BTreeItem

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

func (BTreeItem) Less

func (a BTreeItem) Less(b btree.Item) bool

type DataNode

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

type Store

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

func GetSharedStore added in v0.1.0

func GetSharedStore() *Store

GetSharedStore ensures a single global store instance

type StoreBuilder added in v0.1.0

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

StoreBuilder - Allows configuring store before initialization

func NewStoreBuilder added in v0.1.0

func NewStoreBuilder() *StoreBuilder

NewStoreBuilder creates a new builder

func (*StoreBuilder) Build added in v0.1.0

func (b *StoreBuilder) Build()

Build sets the configuration and initializes the singleton

func (*StoreBuilder) SetMaxSize added in v0.1.0

func (b *StoreBuilder) SetMaxSize(size int) *StoreBuilder

SetMaxSize configures the max size

type StoreConfig added in v0.1.0

type StoreConfig struct {
	MaxSize int
}

StoreConfig - Configuration settings for Store

Jump to

Keyboard shortcuts

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