memcached_client 0.5.3

  • README.md
  • Installing
  • Versions
  • 0

#Memcached Client

Memcached Client is a client implementation in Dart language of the famous distributed memory object caching system, [Memcached] (http://memcached.org/).

Memcached Client is distributed under the Apache 2.0 License.

##Install from Dart Pub Repository

Add this to your pubspec.yaml (or create it):

dependencies:
  memcached_client:

Then run the Pub Package Manager (comes with the Dart SDK):

pub install

##Install from Github for Bleeding Edge Stuff

To install stuff that is still in development, add this to your pubspec.yam:

dependencies:
  memcached_client:
    git: git://github.com/rikulo/memcached-client.git

For more information, please refer to [Pub: Dependencies] (http://pub.dartlang.org/doc/pubspec.html#dependencies).

##Usage

Using Memcached Client is straightforward. Connect to the server and use the client's APIs to access the database.

import "dart:convert" show UTF8;
import "dart:async";
import "package:memcached_client/memcached_client.dart";

void main() {
  // Connect to server per the provided SocketAddress
  // Here assume your Memcached Server is installed on localhost
  MemcachedClient.connect([new SocketAddress("127.0.0.1", 11211)])
  // When client is ready, access the database
  .then((client) => access(client))
  // Catch all possible errors/exceptions
  .catchError((err) => print('Exception: $err'));
}

// The unique document id of the document
final String DOC_ID = "beer_Wrath";

// The Json encoded document
final String VALUE =
  '{"name":"Wrath","abv":9.0,'
  '"type":"beer","brewery_id":"110f1a10e7",'
  '"updated":"2010-07-22 20:00:20",'
  '"description":"WRATH Belgian-style ",'
  '"style":"Other Belgian-Style Ales",'
  '"category":"Belgian and French Ale"}';

Future access(MemcachedClient client) {
  // Do a set
  return client.set(DOC_ID, encodeUtf8(VALUE))
  // Check if set succeeded and show message
  .then((ok) => print(ok ? "Set Succeeded" : "Set failed"))
  // Then get the value back by document id
  .then((_) => client.get(DOC_ID))
  // Check if get data equals to set one
  .then((val) => UTF8.decode(val.data) == VALUE)
  // Show message
  .then((ok) => print(ok ? "Get Succeeded" : "Get failed"))
  // Close the client
  .then((_) => client.close());
}

##Notes to Contributors

###Test and Debug

You are welcome to submit [bugs and feature requests] (https://github.com/rikulo/memcached-client/issues). Or even better if you can fix or implement them!

###Fork Memcached Client

If you'd like to contribute back to the core, you can [fork this repository] (https://help.github.com/articles/fork-a-repo) and send us a pull request, when it is ready.

Please be aware that one of Memcached Client's design goals is to keep the sphere of API as neat and consistency as possible. Strong enhancement always demands greater consensus.

If you are new to Git or GitHub, please read this guide first.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  memcached_client: ^0.5.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:memcached_client/memcached_client.dart';
  
Version Uploaded Documentation Archive
0.5.3 Jun 25, 2014 Go to the documentation of memcached_client 0.5.3 Download memcached_client 0.5.3 archive
0.5.2 Jun 25, 2014 Go to the documentation of memcached_client 0.5.2 Download memcached_client 0.5.2 archive
0.5.1+1 Oct 30, 2013 Go to the documentation of memcached_client 0.5.1+1 Download memcached_client 0.5.1+1 archive
0.5.1 Oct 30, 2013 Go to the documentation of memcached_client 0.5.1 Download memcached_client 0.5.1 archive
0.5.0+2 Sep 12, 2013 Go to the documentation of memcached_client 0.5.0+2 Download memcached_client 0.5.0+2 archive
0.5.0+1 Sep 9, 2013 Go to the documentation of memcached_client 0.5.0+1 Download memcached_client 0.5.0+1 archive
0.5.0 Aug 20, 2013 Go to the documentation of memcached_client 0.5.0 Download memcached_client 0.5.0 archive
0.4.0+1 Aug 5, 2013 Go to the documentation of memcached_client 0.4.0+1 Download memcached_client 0.4.0+1 archive
0.3.0+7 Jun 17, 2013 Go to the documentation of memcached_client 0.3.0+7 Download memcached_client 0.3.0+7 archive
0.3.0+6 Jun 11, 2013 Go to the documentation of memcached_client 0.3.0+6 Download memcached_client 0.3.0+6 archive

All 18 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms:

Low code quality prevents platform classification.

Health issues and suggestions

Fix lib/src/op/text/TextStoreOP.dart. (-82.20 points)

Analysis of lib/src/op/text/TextStoreOP.dart failed with 6 errors, including:

line 52 col 17: Undefined name 'UTF8'.

line 54 col 17: Undefined name 'UTF8'.

line 56 col 17: Undefined name 'UTF8'.

line 58 col 17: Undefined name 'UTF8'.

line 60 col 17: Undefined name 'UTF8'.

Fix lib/src/spi/HashAlgorithm.dart. (-76.74 points)

Analysis of lib/src/spi/HashAlgorithm.dart failed with 5 errors, 4 hints, including:

line 21 col 29: Undefined name 'UTF8'.

line 78 col 17: The class 'MD5' doesn't have a default constructor.

line 79 col 7: The method 'add' isn't defined for the class 'MD5'.

line 79 col 11: Undefined name 'UTF8'.

line 80 col 14: The method 'close' isn't defined for the class 'MD5'.

Fix lib/src/op/OP.dart. (-68.36 points)

Analysis of lib/src/op/OP.dart failed with 4 errors:

line 108 col 16: Undefined name 'UTF8'.

line 109 col 15: Undefined name 'UTF8'.

line 110 col 13: Undefined name 'UTF8'.

line 111 col 13: Undefined name 'UTF8'.

Fix additional 83 files with analysis or formatting issues. (-1270.07 points)

Additional issues in the following files:

  • lib/src/op/binary/BinaryKeyStatsOP.dart (3 errors, 1 hint)
  • lib/src/op/binary/BinaryStatsOP.dart (3 errors, 1 hint)
  • lib/src/op/text/TextGetAndLockOP.dart (3 errors)
  • lib/src/op/text/TextMutateOP.dart (3 errors)
  • lib/src/op/text/TextTouchOP.dart (3 errors)
  • lib/src/spi/MemcachedClientImpl.dart (2 errors, 3 hints)
  • lib/src/op/binary/BinaryGetOP.dart (2 errors, 1 hint)
  • lib/src/op/binary/BinaryOPChannel.dart (2 errors, 1 hint)
  • lib/src/op/text/TextStatsOP.dart (2 errors, 1 hint)
  • lib/src/util/HttpUtil.dart (2 errors, 1 hint)
  • lib/src/op/binary/BinaryGetAndLockOP.dart (2 errors)
  • lib/src/op/binary/BinaryGetAndTouchOP.dart (2 errors)
  • lib/src/op/binary/BinaryGetSingleOP.dart (2 errors)
  • lib/src/op/text/TextDeleteOP.dart (2 errors)
  • lib/src/op/text/TextGetOP.dart (2 errors)
  • lib/src/op/text/TextGetSingleOP.dart (2 errors)
  • lib/src/spi/ConnectionFactoryBase.dart (2 errors)
  • lib/src/op/tap/RequestMessage.dart (1 error, 1 hint)
  • lib/src/op/text/TextNoOP.dart (1 error, 1 hint)
  • lib/src/op/text/TextVersionOP.dart (1 error, 1 hint)
  • lib/src/TapClient.dart (1 error)
  • lib/src/op/binary/BinaryDeleteOP.dart (1 error)
  • lib/src/op/binary/BinaryMutateOP.dart (1 error)
  • lib/src/op/binary/BinaryStoreOP.dart (1 error)
  • lib/src/op/binary/BinaryTouchOP.dart (1 error)
  • lib/src/op/binary/BinaryUnlockOP.dart (1 error)
  • lib/src/op/binary/BinaryVersionOP.dart (1 error)
  • lib/src/op/binary/ObserveOP.dart (1 error)
  • lib/src/op/binary/SaslMechsOP.dart (1 error)
  • lib/src/op/binary/SaslOP.dart (1 error)
  • lib/src/op/tap/TapAckOP.dart (1 error)
  • lib/src/op/text/TextOP.dart (1 error)
  • lib/src/spi/ArrayModNodeLocator.dart (1 error)
  • lib/src/spi/KetamaNodeLocator.dart (1 error)
  • lib/src/util/ByteUtil.dart (1 error)
  • lib/memcached_client.dart (2 hints)
  • lib/src/op/OPChannel.dart (1 hint)
  • lib/src/op/binary/BinaryOP.dart (1 hint)
  • lib/src/spi/MemcachedConnection.dart (1 hint)
  • lib/src/BinaryConnectionFactory.dart (Run dartfmt to format lib/src/BinaryConnectionFactory.dart.)
  • lib/src/MemcachedClient.dart (Run dartfmt to format lib/src/MemcachedClient.dart.)
  • lib/src/TextConnectionFactory.dart (Run dartfmt to format lib/src/TextConnectionFactory.dart.)
  • lib/src/auth/AuthDescriptor.dart (Run dartfmt to format lib/src/auth/AuthDescriptor.dart.)
  • lib/src/op/OPFactory.dart (Run dartfmt to format lib/src/op/OPFactory.dart.)
  • lib/src/op/OPState.dart (Run dartfmt to format lib/src/op/OPState.dart.)
  • lib/src/op/OPStatus.dart (Run dartfmt to format lib/src/op/OPStatus.dart.)
  • lib/src/op/OPType.dart (Run dartfmt to format lib/src/op/OPType.dart.)
  • lib/src/op/ObserveResult.dart (Run dartfmt to format lib/src/op/ObserveResult.dart.)
  • lib/src/op/ObserveStatus.dart (Run dartfmt to format lib/src/op/ObserveStatus.dart.)
  • lib/src/op/StreamOP.dart (Run dartfmt to format lib/src/op/StreamOP.dart.)
  • lib/src/op/VbucketAwareOP.dart (Run dartfmt to format lib/src/op/VbucketAwareOP.dart.)
  • lib/src/op/binary/BinaryMemcachedNodeImpl.dart (Run dartfmt to format lib/src/op/binary/BinaryMemcachedNodeImpl.dart.)
  • lib/src/op/binary/BinaryNoOP.dart (Run dartfmt to format lib/src/op/binary/BinaryNoOP.dart.)
  • lib/src/op/binary/BinaryOPFactory.dart (Run dartfmt to format lib/src/op/binary/BinaryOPFactory.dart.)
  • lib/src/op/binary/MultiKeyOP.dart (Run dartfmt to format lib/src/op/binary/MultiKeyOP.dart.)
  • lib/src/op/binary/SaslAuthOP.dart (Run dartfmt to format lib/src/op/binary/SaslAuthOP.dart.)
  • lib/src/op/binary/SaslStepOP.dart (Run dartfmt to format lib/src/op/binary/SaslStepOP.dart.)
  • lib/src/op/binary/SingleKeyOP.dart (Run dartfmt to format lib/src/op/binary/SingleKeyOP.dart.)
  • lib/src/op/tap/ResponseMessage.dart (Run dartfmt to format lib/src/op/tap/ResponseMessage.dart.)
  • lib/src/op/tap/TapAck.dart (Run dartfmt to format lib/src/op/tap/TapAck.dart.)
  • lib/src/op/tap/TapBackfillOP.dart (Run dartfmt to format lib/src/op/tap/TapBackfillOP.dart.)
  • lib/src/op/tap/TapDumpOP.dart (Run dartfmt to format lib/src/op/tap/TapDumpOP.dart.)
  • lib/src/op/tap/TapOpcode.dart (Run dartfmt to format lib/src/op/tap/TapOpcode.dart.)
  • lib/src/op/tap/TapRequestFlag.dart (Run dartfmt to format lib/src/op/tap/TapRequestFlag.dart.)
  • lib/src/op/tap/TapRequestOP.dart (Run dartfmt to format lib/src/op/tap/TapRequestOP.dart.)
  • lib/src/op/tap/TapResponseFlag.dart (Run dartfmt to format lib/src/op/tap/TapResponseFlag.dart.)
  • lib/src/op/tap/TapStream.dart (Run dartfmt to format lib/src/op/tap/TapStream.dart.)
  • lib/src/op/text/TextMemcachedNodeImpl.dart (Run dartfmt to format lib/src/op/text/TextMemcachedNodeImpl.dart.)
  • lib/src/op/text/TextOPChannel.dart (Run dartfmt to format lib/src/op/text/TextOPChannel.dart.)
  • lib/src/op/text/TextOPFactory.dart (Run dartfmt to format lib/src/op/text/TextOPFactory.dart.)
  • lib/src/op/text/TextOPStatus.dart (Run dartfmt to format lib/src/op/text/TextOPStatus.dart.)
  • lib/src/op/text/TextSingleKeyOP.dart (Run dartfmt to format lib/src/op/text/TextSingleKeyOP.dart.)
  • lib/src/op/text/TextUnlockOP.dart ()
  • lib/src/spi/ConnectionObserver.dart (Run dartfmt to format lib/src/spi/ConnectionObserver.dart.)
  • lib/src/spi/FailureMode.dart (Run dartfmt to format lib/src/spi/FailureMode.dart.)
  • lib/src/spi/MemcachedNode.dart (Run dartfmt to format lib/src/spi/MemcachedNode.dart.)
  • lib/src/spi/TapConnectionProvider.dart (Run dartfmt to format lib/src/spi/TapConnectionProvider.dart.)
  • lib/src/util/AsyncUtil.dart ()
  • lib/src/util/Enum.dart (Run dartfmt to format lib/src/util/Enum.dart.)
  • lib/src/util/HashCodeUtil.dart (Run dartfmt to format lib/src/util/HashCodeUtil.dart.)
  • lib/src/util/LoggingUtil.dart (Run dartfmt to format lib/src/util/LoggingUtil.dart.)
  • lib/src/util/Observable.dart (Run dartfmt to format lib/src/util/Observable.dart.)
  • lib/src/util/SocketAddress.dart (Run dartfmt to format lib/src/util/SocketAddress.dart.)

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Low code quality prevents platform classification.

Package is too old. (-100 points)

The package was released more than two years ago.

Maintain CHANGELOG.md. (-20 points)

Changelog entries help clients to follow the progress in your code.

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 2 dependencies without version constraints. Specify version ranges for the following dependencies: crypto, logging.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use memcached_client.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.4.0
crypto any 2.0.6
logging any 0.11.3+2
Transitive dependencies
charcode 1.1.2
collection 1.14.11
convert 2.0.2
typed_data 1.1.6
Dev dependencies
unittest any