CloudflareDurableObjectStore constructor

CloudflareDurableObjectStore({
  1. required CloudflareDurableObjectNamespace namespace,
  2. String objectPrefix = 'routed-store',
  3. int shardCount = 16,
})

Performs the CloudflareDurableObjectStore operation.

Implementation

CloudflareDurableObjectStore({
  required CloudflareDurableObjectNamespace namespace,
  this.objectPrefix = 'routed-store',
  this.shardCount = 16,
}) : _namespace = namespace {
  if (objectPrefix.trim().isEmpty) {
    throw ArgumentError.value(
      objectPrefix,
      'objectPrefix',
      'must not be empty',
    );
  }
  if (shardCount < 1 || shardCount > 256) {
    throw ArgumentError.value(
      shardCount,
      'shardCount',
      'must be between 1 and 256',
    );
  }
}