StorX Documentation

  • Theme Icon

S3 Compatible Solutions to Connect Storx Programmatically

Here We have created some examples to connect storx with your application programmatically using golang and s3 utility packages.

Prerequisites

Before running the code, ensure you have the following prerequisites:

  • Credentials created from dashboard.
  • Go installed on your machine.

Security Considerations

It's important to handle access credentials securely. Avoid hardcoding credentials directly into the code. Instead, consider using environment variables or other secure methods for credential management. Additionally, ensure that IAM policies associated with the credentials provide the least privilege necessary for your application's functionality.

Dependencies in Go

icon icon

Required Values

icon icon

Required Objects

icon icon

1. Creating a Session

The CreateSession function establishes a new session with the S3-compatible solution using provided credentials. Sessions are essential for making requests to S3-compatible services.

icon icon

Example:

icon icon

2. Creating a Bucket

The CreateBucket function creates a new bucket with the given name.

icon icon

Example:

icon icon

3. Listing Buckets

The ListBuckets function retrieves a list of all buckets associated with the account.

icon icon

Example:

icon icon

4. Creating a Folder in a Bucket

The CreateFolder function creates a folder (prefix) within an existing bucket.

icon icon

Example:

icon icon

5. Listing Files in a Bucket

The ListFilesInBucket function lists all files (objects) in a given bucket, optionally filtered by a specific path.

icon icon

Example:

icon icon

6. Uploading a File to a Bucket

The UploadFile function uploads a file to a specified location within an bucket.

icon icon

Example:

icon icon