sqlite

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sqlite provides a SQLite storage backend.

This is the recommended storage backend for Lightsail deployments. Data is persisted to a local SQLite database file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Path is the database file path.
	Path string
}

Config configures the SQLite storage.

type Storage

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

Storage implements storage.Storage with SQLite.

func New

func New(cfg Config) (*Storage, error)

New creates a new SQLite storage.

func (*Storage) Close

func (s *Storage) Close() error

Close releases storage resources.

func (*Storage) Delete

func (s *Storage) Delete(ctx context.Context, key string) error

Delete removes a key.

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, key string) ([]byte, error)

Get retrieves a value by key.

func (*Storage) Path

func (s *Storage) Path() string

Path returns the database file path.

func (*Storage) Set

func (s *Storage) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error

Set stores a value with an optional TTL.

Jump to

Keyboard shortcuts

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