S3Storage constructor

S3Storage({
  1. required String endPoint,
  2. required String accessKey,
  3. required String secretKey,
  4. SigningType signingType = SigningType.V2,
  5. int? port,
  6. bool useSSL = true,
  7. String userAgent = 's3-storage-dart',
  8. String? sessionToken,
  9. String? region,
  10. bool enableTrace = false,
})

Initializes a new client object.

Implementation

S3Storage({
  required this.endPoint,
  required this.accessKey,
  required this.secretKey,
  this.signingType = SigningType.V2,
  int? port,
  this.useSSL = true,
  this.userAgent = 's3-storage-dart',
  this.sessionToken,
  this.region,
  this.enableTrace = false,
}) : port = port ?? implyPort(useSSL) {
  if (!isValidEndpoint(endPoint)) {
    throw StorageInvalidEndpointError(
      'End point $endPoint is not a valid domain or ip address',
    );
  }

  if (!isValidPort(this.port)) {
    throw StorageInvalidPortError(
      'Invalid port number ${this.port}',
    );
  }

  _client = StorageClient(this, signingType);
}