remove demos that are not yet functional

This commit is contained in:
Emil Lerch 2023-08-27 11:54:31 -07:00
parent ae07f82dd5
commit 779d940849
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -236,9 +236,13 @@ pub fn main() anyerror!void {
std.log.info("key group quantity: {d}", .{list.quantity}); std.log.info("key group quantity: {d}", .{list.quantity});
}, },
.rest_xml_work_with_s3 => { .rest_xml_work_with_s3 => {
// TODO: This test makes the compiler try to create a monomorphic function
// that frees both a bool and an i64
std.log.err("This demo (rest_xml_work_with_s3) is not yet fully functional in 0.11", .{});
const key = "i/am/a/teapot/foo"; const key = "i/am/a/teapot/foo";
// const key = "foo"; _ = key;
// // const key = "foo";
//
const bucket = blk: { const bucket = blk: {
const result = try client.call(services.s3.list_buckets.Request{}, options); const result = try client.call(services.s3.list_buckets.Request{}, options);
defer result.deinit(); defer result.deinit();
@ -259,43 +263,48 @@ pub fn main() anyerror!void {
break :blk try allocator.dupe(u8, location); break :blk try allocator.dupe(u8, location);
}; };
defer allocator.free(location); defer allocator.free(location);
const s3opts = aws.Options{ const s3opts = aws.Options{
.region = location, .region = location,
.client = client, .client = client,
}; };
{ // TODO: This block triggers the free(bool) problem. Note that the rest of this will have runtime issues
const result = try aws.Request(services.s3.put_object).call(.{ // without the block
.bucket = bucket, // {
.key = key, // const result = try aws.Request(services.s3.put_object).call(.{
.content_type = "text/plain", // .bucket = bucket,
.body = "bar", // .key = key,
.storage_class = "STANDARD", // .content_type = "text/plain",
}, s3opts); // .body = "bar",
std.log.info("PutObject Request id: {any}", .{result.response_metadata.request_id}); // .storage_class = "STANDARD",
std.log.info("PutObject etag: {any}", .{result.response.e_tag.?}); // }, s3opts);
defer result.deinit(); // std.log.info("PutObject Request id: {any}", .{result.response_metadata.request_id});
} // std.log.info("PutObject etag: {any}", .{result.response.e_tag.?});
{ // defer result.deinit();
// Note that boto appears to redirect by default, but java // }
// does not. We will not // TODO: This block triggers both compile errors
const result = try aws.Request(services.s3.get_object).call(.{ // {
.bucket = bucket, // // Note that boto appears to redirect by default, but java
.key = key, // // does not. We will not
}, s3opts); // const result = try aws.Request(services.s3.get_object).call(.{
std.log.info("GetObject Request id: {any}", .{result.response_metadata.request_id}); // .bucket = bucket,
std.log.info("GetObject Body: {any}", .{result.response.body}); // .key = key,
std.log.info("GetObject etag: {any}", .{result.response.e_tag.?}); // }, s3opts);
std.log.info("GetObject last modified (seconds since epoch): {d}", .{result.response.last_modified.?}); // std.log.info("GetObject Request id: {any}", .{result.response_metadata.request_id});
defer result.deinit(); // std.log.info("GetObject Body: {any}", .{result.response.body});
} // std.log.info("GetObject etag: {any}", .{result.response.e_tag.?});
{ // std.log.info("GetObject last modified (seconds since epoch): {d}", .{result.response.last_modified.?});
const result = try aws.Request(services.s3.delete_object).call(.{ // defer result.deinit();
.bucket = bucket, // }
.key = key, // TODO: This block triggers the free(bool) problem. Note that the rest of this will have runtime issues
}, s3opts); // {
std.log.info("DeleteObject Request id: {any}", .{result.response_metadata.request_id}); // const result = try aws.Request(services.s3.delete_object).call(.{
defer result.deinit(); // .bucket = bucket,
} // .key = key,
// }, s3opts);
// std.log.info("DeleteObject Request id: {any}", .{result.response_metadata.request_id});
// defer result.deinit();
// }
{ {
const result = try aws.Request(services.s3.list_objects).call(.{ const result = try aws.Request(services.s3.list_objects).call(.{
.bucket = bucket, .bucket = bucket,