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 ¶
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 ¶
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. |