shorebird_redis_client 0.0.1 shorebird_redis_client: ^0.0.1 copied to clipboard
A lightweight Dart client library for communicating with a Redis server. Built by Shorebird.
๐ฆ Shorebird Redis Client #
A Dart library for interacting with a Redis server.
Built with ๐ by Shorebird.
Quick Start ๐ #
import 'package:shorebird_redis_client/shorebird_redis_client.dart';
Future<void> main() async {
// Create an instance of a RedisClient.
final client = RedisClient();
// Connect to the Redis server.
await client.connect();
// Set the value of a key.
await client.set(key: 'HELLO', value: 'WORLD');
// Get the value of a key.
final value = await client.get(key: 'HELLO'); // WORLD
// Delete the key.
await client.delete(key: 'HELLO');
// Close the connection to the Redis server.
await client.close();
}
Testing ๐งช #
To run the tests locally, ensure you have Docker installed and pull the redis-stack-server image:
docker pull redis/redis-stack-server
Then, start the server:
docker run -p 6379:6379 --rm -e REDIS_ARGS="--requirepass password" redis/redis-stack-server
Now you can run the tests locally:
dart test
License ๐ #
Shorebird packages are licensed for use under either Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
See our license philosophy for more information on why we license files this way: https://github.com/shorebirdtech/handbook/blob/main/engineering.md#licensing-philosophy