Zig
Zig
Wasabi Create Bucket
See more Wasabi Examples
Demonstrates how to create a new Wasabi bucket.Chilkat Zig Downloads
const std = @import("std");
const chilkat = @import("chilkat");
pub fn main(init: std.process.Init) !void {
const alloc = init.arena.allocator();
var success: bool = false;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
const http = try chilkat.Http.init();
defer http.deinit();
// Insert your access key here:
http.setAwsAccessKey("access-key");
// Insert your secret key here:
http.setAwsSecretKey("secret-key");
// To create a bucket located in a different region, use the domain for that region, such as "s3.eu-central-1.wasabisys.com"
http.setAwsEndpoint("s3.wasabisys.com");
// Change the bucket name here to something unique:
success = if (http.s3CreateBucket("chilkat-wasabi-testbucket")) true else |_| false;
if (!success) {
std.debug.print("{s}\n", .{try http.getLastErrorText(alloc)});
} else {
std.debug.print("Bucket created.\n", .{});
}
}