Minio constructor

Minio({
  1. required String endPoint,
  2. required String accessKey,
  3. required String secretKey,
  4. int? port,
  5. bool useSSL = true,
  6. String? sessionToken,
  7. String? region,
  8. bool enableTrace = false,
})

Initializes a new client object.

Implementation

Minio({
  required this.endPoint,
  required this.accessKey,
  required this.secretKey,
  int? port,
  this.useSSL = true,
  this.sessionToken,
  this.region,
  this.enableTrace = false,
}) : port = port ?? implyPort(useSSL) {
  if (!isValidEndpoint(endPoint)) {
    throw MinioInvalidEndpointError(
      'End point $endPoint is not a valid domain or ip address',
    );
  }

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

  _client = MinioClient(this);
}