Skip to content

Commit fca3424

Browse files
committed
Update README.md and example for Zig 0.16
1 parent 4b8e064 commit fca3424

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
An AWS SDK for Zig, providing AWS service clients from [Smithy models](https://aws.amazon.com/blogs/aws/introducing-aws-api-models-and-publicly-available-resources-for-aws-api-definitions/), built using a Kotlin code generator.
44

5-
Requires Zig 0.15.0 or later.
5+
The latest changes require Zig 0.16.0 or later. The `zig-0.15` branch exists for Zig 0.15.x.
66

77
## Available Services
88

@@ -33,13 +33,11 @@ const std = @import("std");
3333
const aws = @import("aws");
3434
const s3 = @import("s3");
3535
36-
pub fn main() !void {
37-
var gpa: std.heap.GeneralPurposeAllocator(.{}) = .init;
38-
defer _ = gpa.deinit();
39-
const allocator = gpa.allocator();
36+
pub fn main(init: std.process.Init) !void {
37+
const allocator = init.gpa;
4038
4139
// Load configuration from the environment and/or ~/.aws directory.
42-
var config = try aws.Config.load(allocator, .{});
40+
var config = try aws.Config.load(allocator, init.io, init.environ_map, .{});
4341
defer config.deinit();
4442
4543
// Create the S3 client.

examples/s3-list-buckets/build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
.minimum_zig_version = "0.15.2",
66
.dependencies = .{
77
.aws_sdk = .{
8-
.url = "git+https://github.com/cloudboss/aws-sdk-zig.git#4be9ffd8e4e081f68504c31d0a8cb742c1b811a4",
9-
.hash = "aws_sdk-0.0.1-ApQSL4OTMhDFbTJtcTNhB2oXNQ9J2ROPTvfV-Hvljt6x",
8+
.url = "git+https://github.com/cloudboss/aws-sdk-zig.git#4b8e0646cbe1622f8fd07daf7e22df3bfee7c1e0",
9+
.hash = "aws_sdk-0.0.1-ApQSL-HdixBVxS0U-xc2jrtlR4oL90TbPgVBl9BoLpJi",
1010
},
1111
},
1212
.paths = .{

examples/s3-list-buckets/src/main.zig

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ const std = @import("std");
33
const aws = @import("aws");
44
const s3 = @import("s3");
55

6-
pub fn main() !void {
7-
var gpa: std.heap.DebugAllocator(.{}) = .init;
8-
defer _ = gpa.deinit();
9-
const allocator = gpa.allocator();
6+
pub fn main(init: std.process.Init) !void {
7+
const allocator = init.gpa;
108

119
// Load configuration from the environment and/or ~/.aws directory.
12-
var config = try aws.Config.load(allocator, .{});
10+
var config = try aws.Config.load(allocator, init.io, init.environ_map, .{});
1311
defer config.deinit();
1412

1513
// Create an S3 client.

0 commit comments

Comments
 (0)