init static method

Minio init({
  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,
})

Implementation

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

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

  _instance = Minio._(
    endPoint: endPoint,
    accessKey: accessKey,
    secretKey: secretKey,
    port: portParam,
    useSSL: useSSL,
    sessionToken: sessionToken,
    region: region,
    enableTrace: enableTrace,
  );
  return _instance!;
}