Data Storage:

At LightningUserVault, we value flexibility. With our Storage interface, you can easily integrate a variety of storage systems. We currently support Pebble for key-value storage and PostgreSQL for SQL, but the architecture allows for easy expansion.

Currently Supported:

  1. Pebble (Key-Value)

  2. PostgreSQL (SQL)

🔌 Storage Interface:

If you're interested in adding more storage options, here's the interface to guide you:

type Storage interface {
	// Set stores a value and returns user ID and an error if any issue occurs during the operation
	Set(value string) (int64, error)

	// Get retrieves the value for a given user ID and returns an error if any issue occurs during the operation
	Get(key int64) (*common.User, error)

	// Close closes storage instance
	Close() error
}

🧪 Mock Implementations for Testing

For developers and testers, we offer mock implementation of database interface

Usage example:

Last updated