Building with Go

FunctionGraph Types

FunctionGraph provides 2 types of functions:

  • Event Functions

    Event functions can be configured with event triggers and integrate a variety of products (such as object storage service OBS, distributed messaging service RabbitMQ version, cloud log service LTS, etc.).

    See Event Function

  • HTTP Functions

    HTTP functions support mainstream Web application frameworks and can be accessed through a browser or called directly by a URL.

    See HTTP Functions

Both types of functions can be built either from scratch or by using container images.

Supported Go Runtimes for building from scratch

FunctionGraph currently supports the following Go runtimes for building functions from scratch:

Supported Go runtimes

Runtime

Description

Identifier

Go 1.x

Supports Go 1.x

Go1.x

Supported Go Runtimes for building using container images

For building functions using container images, you can use any Go version that meets the requirements of your custom container image.

Set up development environment

To build and run the Go runtime for FunctionGraph, you need to set up your development environment by installing the Go programming language.

Operating system

This guide assumes that you are using a Unix-like operating system such as

Install Go

  1. Download the Go installation package for your operating system from the official Go website.

  2. Follow the installation instructions provided on the website to install Go on your system.

Install an IDE

You can use any text editor or IDE to write Go code.

To maximize your Go development efficacy, follow the Go recommendations on Editor plugins and IDEs.

These provide the following features:

  • Fully integrated debugging capabilities

  • Syntax highlighting

  • Code completion

Note

Examples in this documentation were created using:

  • WSL and

  • Visual Studio Code.