Releases · by-nir/aws-lambda-zig · GitHub
Skip to content

Releases: by-nir/aws-lambda-zig

0.6.1

Choose a tag to compare

@Nirlah Nirlah released this 13 May 20:09

[Breaking] Open stream APIs now accept a buffer parameter.

0.6.0

Choose a tag to compare

@Nirlah Nirlah released this 12 May 13:29

[Breaking] URL Event API

// Request
try lambda.url.Request.init(arena, .{ ··· })
    ⬇️
try lambda.url.parseRequest(arena, .{ ··· })

// Response
try lambda.url.Response.encode(.{ ··· }, arena)
    ⬇️
try lambda.url.encodeResponse(arena, .{ ··· })

0.5.1

Choose a tag to compare

@Nirlah Nirlah released this 08 May 16:05

Fix context’s io.

0.5.0

Choose a tag to compare

@Nirlah Nirlah released this 17 Apr 16:18
  • Upgraded to Zig 0.16! (thanks @frettedfeline)
  • Implemented the Metadata API.
  • Reverted the explicit -Darch check warning.

[Breaking] Process Init

The Lambda handler requires a std init provided by the new Juicy Main.

const std = @import("std");
const lambda = @import("aws-lambda");

// Entry point for the Lambda function.
pub fn main(init: std.process.Init) void {
    // Bind the handler to the runtime:
    lambda.handle(init, handler, .{});
}

Metadata API

The handler context has a new method to discovery the Lambda runtime metadata, specifically the Availability Zone ID.

💡See the Debug demo for a working example.

const meta = try ctx.runtimeMetadata();
Field Type Description
availability_zone_id []const u8 Availability Zone ID where the Lambda function is executed.

0.4.0

Choose a tag to compare

@Nirlah Nirlah released this 19 Aug 17:44
  • Upgraded to Zig 0.15.0.

[BREAKING] Response Streaming

  • Use the standard writer for response streaming.
  • See stream and url_stream demos for updated usage.

0.3.1

Choose a tag to compare

@Nirlah Nirlah released this 06 Jul 14:35
  • Update the package manifest for Zig 0.14 (thanks @vytskalt)
  • Update the docs for Zig 0.14 best practices.
  • Add the package version to the user agent.
  • Warn when building a handler executable without explicit -Darch option.

0.3.0

Choose a tag to compare

@Nirlah Nirlah released this 11 Dec 04:38

Lambda URLs

Added event decoders & encoders for both buffered and streaming Lambda URLs.
Check out the demos to learn how to use lambda.url.

Response Streaming

[BREAKING] Formatting convention

Replaced stream.writeFmt(···) and stream.publishFmt(···) with a conventional stream.writer().

[BREAKING] Removed stream.closeWithError

It seems that while the HTTP payloads are sent correctly to the Runtime API – the behavior is ignored.
I'm removing it until further investigation so I could implement it with confidence.

In the meanwhile, the same can be achieved by combining lambda.log(···), stream.publish(···), stream.close(), and the new ctx.forceTerminateAfterResponse().

Open With Payload

Allows opening the stream and sending an initial body payload to the Runtime API in a single call.
This is mostly for supporting Lambda’s HTTP Integration protocol.

const raw_http = "6\r\nHello!\r\n";
try stream.openWith("text/plain", raw_http);

Warning

Note that the payload is raw, as it merely appends the bytes to the HTTP request – it’s up to the user to format it with proper semantics (or use one of the new Event Encoders).

Misc

  • Support for scheduling termination of the function instance until after the handler provides a response to the client:
    ctx.forceTerminateAfterResponse();
  • Add GPA allocator leak detection in debug mode.

0.2.2

Choose a tag to compare

@Nirlah Nirlah released this 08 Dec 00:18
  • Support async invocation

0.2.1

Choose a tag to compare

@Nirlah Nirlah released this 07 Dec 19:23
  • Merge handler context into a single struct

0.1.2

Choose a tag to compare

@Nirlah Nirlah released this 06 Dec 03:13
Rename module name