store

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package store provides a registry and entry point for cache backends.

This package allows you to register cache drivers and open cache connections using a DSN string. It acts as a facade over the internal registry and the driver interfaces defined in the driver subpackage.

Most users won't interact with this package directly, but will instead use it indirectly through higher-level caching abstractions. For more details on registering drivers and opening connections, see the documentation for the Register and Open functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Drivers

func Drivers() []string

Drivers returns a sorted list of the names of the registered drivers.

func Open

func Open(dsn string) (driver.Conn, error)

Open establishes a connection to a registered driver, as specified in the provided DSN string.

The DSN (Data Source Name) format follows the pattern:

scheme://[path]?[query_parameters]

Where:

  • scheme: The name of the registered driver (e.g., "memcache", "fscache", etc.).
  • path: An optional path component that can be used by the driver for configuration.
  • query_parameters: Optional key-value pairs for additional driver- specific settings.

See Register for registering drivers.

func Register

func Register(name string, driver driver.Driver)

Register makes a driver implementation available by the provided name (e.g., "memcache", "fscache", etc.). The name corresponds to the scheme component of a DSN string used in Open to identify the driver to use. If Register is called twice with the same name or if driver is nil, it panics.

Types

This section is empty.

Directories

Path Synopsis
Package acceptance provides a suite of acceptance tests for Cache implementations.
Package acceptance provides a suite of acceptance tests for Cache implementations.
Package driver defines interfaces to be implemented by cache backends as used by the github.com/bartventer/httpcache/store package.
Package driver defines interfaces to be implemented by cache backends as used by the github.com/bartventer/httpcache/store package.
Package expapi provides HTTP handlers for managing and interacting with cache backends.
Package expapi provides HTTP handlers for managing and interacting with cache backends.
Package fscache implements a file system-based cache backend.
Package fscache implements a file system-based cache backend.
internal
registry
Package registry provides a registry for cache drivers.
Package registry provides a registry for cache drivers.
Package memcache implements an in-memory cache backend.
Package memcache implements an in-memory cache backend.

Jump to

Keyboard shortcuts

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