Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MINIO_ACCESS_KEY=kJ1sAPIURDyj5HKjeoqq
MINIO_SECRET_KEY=8Sv8jYmW8uOeAwE4c6cimaRnZLcAsfjPI4qxjt9f
MINIO_PUBLIC_ENDPOINT="https://bucket-production-05b8.up.railway.app:443"
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
MINIO_PUBLIC_ENDPOINT="http://localhost:9000"
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ zig-out/
*.so
*.dylib
*.a
!archive/
!archive/**
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ pub fn main() !void {
var client = try s3.S3Client.init(allocator, .{
.access_key_id = "your-key",
.secret_access_key = "your-secret",
.region = "us-east-1",
// Optional: Use with MinIO or other S3-compatible services
// .endpoint = "http://localhost:9000",
});
Expand All @@ -114,7 +113,6 @@ The main client interface for S3 operations.
const client = try s3.S3Client.init(allocator, .{
.access_key_id = "your-key",
.secret_access_key = "your-secret",
.region = "us-east-1",
.endpoint = "http://localhost:9000", // Optional, for S3-compatible services
});
```
Expand Down
Binary file removed archive/v0.2.0.tar.gz
Binary file not shown.
35 changes: 22 additions & 13 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ pub fn build(b: *std.Build) void {
});

// Create the library that others can use as a dependency
const lib = b.addStaticLibrary(.{
const lib = b.addLibrary(.{
.name = "s3-client",
.root_source_file = b.path("src/s3/lib.zig"),
.target = target,
.optimize = optimize,
.linkage = .static,
.root_module = b.createModule(.{
.root_source_file = b.path("src/s3/lib.zig"),
.target = target,
.optimize = optimize,
}),
});
lib.root_module.addImport("s3", s3_module);
lib.root_module.addImport("dotenv", dotenv_dep.module("dotenv"));
Expand All @@ -29,9 +32,11 @@ pub fn build(b: *std.Build) void {
// Create the example executable
const exe = b.addExecutable(.{
.name = "s3-example",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
}),
});
exe.root_module.addImport("s3", s3_module);
exe.root_module.addImport("dotenv", dotenv_dep.module("dotenv"));
Expand All @@ -48,9 +53,11 @@ pub fn build(b: *std.Build) void {

// Unit tests
const unit_tests = b.addTest(.{
.root_source_file = b.path("src/s3/lib.zig"),
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{
.root_source_file = b.path("src/s3/lib.zig"),
.target = target,
.optimize = optimize,
}),
});
unit_tests.root_module.addImport("dotenv", dotenv_dep.module("dotenv"));
const run_unit_tests = b.addRunArtifact(unit_tests);
Expand All @@ -59,9 +66,11 @@ pub fn build(b: *std.Build) void {

// Integration tests
const integration_tests = b.addTest(.{
.root_source_file = b.path("tests/integration/s3_client_test.zig"),
.target = target,
.optimize = optimize,
.root_module = b.createModule(.{
.root_source_file = b.path("tests/integration/s3_client_test.zig"),
.target = target,
.optimize = optimize,
}),
});
integration_tests.root_module.addImport("s3", s3_module);
integration_tests.root_module.addImport("dotenv", dotenv_dep.module("dotenv"));
Expand Down
6 changes: 3 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
.name = .zig_s3,
.version = "0.2.0",
.fingerprint = 0xf58a772c84221497,
.minimum_zig_version = "0.13.0",
.minimum_zig_version = "0.15.1",
.dependencies = .{
.dotenv = .{
.url = "https://github.com/dying-will-bullet/dotenv/archive/refs/tags/v0.2.0.tar.gz",
.hash = "12201347c20e8c4cb161f16bba30e51da17c32b89ef887b9b8932d6ed135ee5a6d01",
.url = "git+https://github.com/dying-will-bullet/dotenv?ref=master#82a53e32b25371ab255f150aee089e5f8ffba8c1",
.hash = "dotenv-0.2.2-ikMfwBB3AAC89NhL0EVbn6mRYA5z4fec8PcNKJ-P8m16",
},
},
.paths = .{
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
minio:
image: minio/minio
ports:
- 9000:9000
command: "server /data"
5 changes: 3 additions & 2 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ fn loadEnvVars() !s3.S3Config {
return s3.S3Config{
.access_key_id = access_key.?,
.secret_access_key = secret_key.?,
.region = "us-west-1",
.endpoint = endpoint.?,
};
}
Expand Down Expand Up @@ -88,7 +87,9 @@ pub fn main() !void {
}

// Print bucket information
const stdout = std.io.getStdOut().writer();
var stdout_buffer: [1024]u8 = undefined;
var stdout_writer = std.fs.File.stdout().writer(&stdout_buffer);
const stdout = &stdout_writer.interface;
try stdout.writeAll("\nAvailable buckets:\n");
for (buckets) |bucket| {
std.log.info("Bucket found: {s}", .{bucket.name});
Expand Down
11 changes: 0 additions & 11 deletions src/root.zig

This file was deleted.

Loading