GitHub

If you find our SDK helpful and enjoyable to use, we would greatly appreciate it if you could take a moment to give us a "like"!

Your support motivates us to continue improving and adding more features.

We are excited to announce that our SDK has been successfully integrated into the RedisLink project!

import 'package:redis_dart_link/client.dart';
import 'package:redis_dart_link/logger.dart';
import 'package:redis_dart_link/model/info.dart';
import 'package:redis_dart_link/socket_options.dart';
RedisClient client = RedisClient(
    socket: RedisSocketOptions(
      host: '127.0.0.1',
      port: 9527,
      password: '123456',
    ),
);
// Connect to the Redis server.
await client.connect();
try {
    await client.ping();
    print("ping");
} catch (error, stackTrace) {
    print("error: $error");
    print("stackTrace: $stackTrace");
}
import 'package:redis_dart_link/client.dart';
import 'package:test/test.dart';
import 'redis_client_init.dart';
void main() {
  group('Redis Commands GEO Tests', () {
    late RedisClient client;
    setUpAll(() async {
      client = await initRedisClient();
    });
    tearDownAll(() async {
      await closeRedisClient(client);
    });
    test('geoAdd command test', () async {
      try {
        await client.geoAdd(
          'test-geoAdd-Sicily',
          13.361389,
          38.115556,
          'Palermo',
        );
        await client.geoAdd(
          'test-geoAdd-Sicily',
          15.087269,
          37.502669,
          'Catania',
        );
        var Val = await client.geoDist(
          'test-geoAdd-Sicily',
          'Palermo',
          'Catania',
        );
        print("geoDist Val.toString() : ${Val}");
      } catch (e) {
        print("An error occurred: $e");
      }
      // });
    }, skip: 'jsonGet Skipping this test temporarily');
    test('geoHash command test', () async {
      try {
        var Val =
            await client.geoHash('test-geoAdd-Sicily', ['Catania', 'Palermo']);
        print("geoHash Val.toString() : ${Val}");
      } catch (e) {
        print("An error occurred: $e");
      }
    }, skip: 'jsonGet Skipping this test temporarily');
    test('geoPos command test', () async {
      try {
        var Val = await client.geoPos(
            'test-geoAdd-Sicily', ['Catania', 'Palermo', 'NonExisting']);
        print("GeoPos Val.toString() : ${Val.toString()}");
      } catch (e) {
        print("An error occurred: $e");
      }
      // });
    }, skip: 'jsonGet Skipping this test temporarily');
  });
}
"import 'package:redis_dart_link/client.dart'; import 'package:redis_dart_link/model.dart'; import 'package:test/test.dart'; import 'redis_client_init.dart'; void main() { group('Redis Commands Tests', () { late RedisClient client; setUpAll(() async { client = await initRedisClient(); }); tearDownAll(() async { await closeRedisClient(client); }); test('hscan command test', () async { try { final Map

Read the original on github.com ↗