Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 1 addition & 105 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ Welcome to the Tigris Storage SDK for Go! This package contains high-level wrapp

[Tigris](https://www.tigrisdata.com/) is a cloud storage service that provides a simple, scalable, and secure object storage solution. It is based on the S3 API, but has additional features that need these helpers.

This SDK provides two main packages:

- **`storage`** - The main package containing the Tigris client with S3-compatible methods plus Tigris-specific features like bucket forking, snapshots, and object renaming.
- **`tigrisheaders`** - Lower-level helpers for setting Tigris-specific HTTP headers on S3 API calls.
This SDK provides the main **`storage`** package containing the Tigris client with S3-compatible methods plus Tigris-specific features like bucket forking, snapshots, and object renaming.
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Overview mentions "Tigris-specific features like bucket forking, snapshots, and object renaming" but some Tigris-specific features documented in the removed section (query metadata, conditional operations, static replication regions) are not mentioned here. Consider clarifying whether this is the complete list of features exposed via the main storage package, or if additional features exist in other packages.

Suggested change
This SDK provides the main **`storage`** package containing the Tigris client with S3-compatible methods plus Tigris-specific features like bucket forking, snapshots, and object renaming.
This SDK provides the main **`storage`** package containing the Tigris client with S3-compatible methods plus Tigris-specific features such as bucket forking, snapshots, and object renaming, as well as additional capabilities (for example, queryable metadata, conditional operations, and static replication-region controls). Some of these advanced features are exposed via supporting packages in this repository.

Copilot uses AI. Check for mistakes.

## Installation

Expand Down Expand Up @@ -130,107 +127,6 @@ _, err := client.RenameObject(ctx, &s3.CopyObjectInput{
})
```

## Using the tigrisheaders Package

The `tigrisheaders` package provides lower-level helpers for setting Tigris-specific HTTP headers. These can be used directly with S3 client operations.

### Static Replication Regions

Control which regions your objects are replicated to:

```go
import "github.com/tigrisdata/storage-go/tigrisheaders"

// Replicate to specific regions
_, err := client.PutObject(ctx, &s3.PutObjectInput{
Bucket: aws.String("my-bucket"),
Key: aws.String("file.txt"),
Body: bytes.NewReader(data),
}, tigrisheaders.WithStaticReplicationRegions([]tigrisheaders.Region{
tigrisheaders.FRA, // Frankfurt
tigrisheaders.SJC, // San Jose
}))
```

Available regions:

- `FRA` - Frankfurt, Germany
- `GRU` - São Paulo, Brazil
- `HKG` - Hong Kong, China
- `IAD` - Ashburn, Virginia, USA
- `JNB` - Johannesburg, South Africa
- `LHR` - London, UK
- `MAD` - Madrid, Spain
- `NRT` - Tokyo (Narita), Japan
- `ORD` - Chicago, Illinois, USA
- `SIN` - Singapore
- `SJC` - San Jose, California, USA
- `SYD` - Sydney, Australia
- `Europe` - European datacenters
- `USA` - American datacenters

### Query Metadata

Filter objects in a ListObjectsV2 request with a SQL-like WHERE clause:

```go
_, err := client.ListObjectsV2(ctx, &s3.ListObjectsV2Input{
Bucket: aws.String("my-bucket"),
}, tigrisheaders.WithQuery("metadata.user_id = '123'"))
```

### Conditional Operations

Perform operations based on object state:

```go
// Create object only if it doesn't exist
_, err := client.PutObject(ctx, input,
tigrisheaders.WithCreateObjectIfNotExists())

// Only proceed if ETag matches
_, err := client.PutObject(ctx, input,
tigrisheaders.WithIfEtagMatches("\"abc123\""))

// Only proceed if modified since date
_, err := client.GetObject(ctx, input,
tigrisheaders.WithModifiedSince(time.Now().Add(-24 * time.Hour)))

// Only proceed if unmodified since date
_, err := client.GetObject(ctx, input,
tigrisheaders.WithUnmodifiedSince(time.Now().Add(-24 * time.Hour)))

// Compare-and-swap (skip cache, read from designated region)
_, err := client.GetObject(ctx, input,
tigrisheaders.WithCompareAndSwap())
```

### Snapshot Operations

Work with specific snapshot versions:

```go
// List objects from a specific snapshot
_, err := client.ListObjectsV2(ctx, &s3.ListObjectsV2Input{
Bucket: aws.String("my-bucket"),
}, tigrisheaders.WithSnapshotVersion("snapshot-id"))

// Get object from a specific snapshot
_, err := client.GetObject(ctx, &s3.GetObjectInput{
Bucket: aws.String("my-bucket"),
Key: aws.String("file.txt"),
}, tigrisheaders.WithSnapshotVersion("snapshot-id"))
```

### Custom Headers

Set arbitrary HTTP headers on requests:

```go
_, err := client.PutObject(ctx, input,
tigrisheaders.WithHeader("X-Custom-Header", "value"))
```

## Documentation

For more information on Tigris features, see:
Expand Down