Skip to content

Releases: mariotoffia/gogreengrass

AWS C Runtime is the only linkage

28 Nov 10:53
Compare
Choose a tag to compare

Removes all Python interop "stuff". Instead a more light weighted approach and integrate only with the AWS C Greengrass runtime. The package is substantially smaller and integration in C is much faster, lighter and gives more "goability".

Lambda support and Partially GGC API support for C runtime

19 Nov 07:18
Compare
Choose a tag to compare

This is way more efficient to use the C runtime instead of interop with python. This is now the preffered method. I'll be investigating how to install a shared go runtime onto GGC so we may do dynamic linking towards that to lower the size of our go lambdas.

But now you may do this:

func main() {
	type MyEvent struct {
		Data  int    `json:"data"`
		Hello string `json:"hello"`
	}

	type MyResponse struct {
		Age   int    `json:"age"`
		Topic string `json:"topic"`
	}

	sdkc.Start(func(c context.Context, data MyEvent) (MyResponse, error) {

		lc, _ := lambdacontext.FromContext(c)

		fmt.Printf(
			"context: %v, topic: %s, data: '%v'\n",
			lc, lc.ClientContext.Custom["subject"], data,
		)

		resp := MyResponse{Age: 19, Topic: "feed/myfunc"}

		sdkc.NewQueue().PublishObject(
			"feed/testlambda", sdkc.QueueFullPolicyOptionAllOrError, &resp,
		)

		return resp, nil
	})
}

Thus this is exactly how the standard cloud aws library expects the registration. You may have some additional options such as running as background thread that GGC has.

Cheers,
Mario :)

First real release

16 Nov 21:39
Compare
Choose a tag to compare

This is very early alpha. I haven't even tried out it properly!

It should work to write your lambdas in go and do a gogreengrass -d that creates shims so it is possible to deploy the go lambda as python 3.x lambda. When this is done, you may add the lambda into green grass core group and deploy to the device.

Please see the internal/example/lambda/main for a very simple lambda - do make build, zip the file and upload it as lambda.

Cheers,
Mario :)

First Release

16 Nov 21:17
Compare
Choose a tag to compare

This is to do the real release of 0.0.4