This topic describes handlers and how to configure handlers in the Go runtime in Function Compute (FC).

What is a handler?

A handler for a function in FC is the method that is used to process requests in the function code. When a FC function is invoked, Function Compute uses the handler that you configure to process requests. You can configure a handler by specifying a value for the Request Handler parameter in the Function Compute console.

The handler for FC functions in the Go language is compiled into an executable binary file. You only need to set the Request Handler parameter of the FC function to the name of the executable file.

For more information about the definitions and operations of functions in FC, see Manage functions.

Configure a handler

When you configure a handler, make sure that you follow the configuration specifications that are described in Function Compute. The configuration specifications vary based on the handler type.

Handlers are classified into event handlers and HTTP handlers. Event requests are generated by event sources, and HTTP requests are generated by HTTP triggers. For more information, see Function types.

For more information about how to configure handlers, see Event handlers and HTTP handlers.

References

For more information about how to compile and deploy your code package to Function Compute, see Compilation and deployment of code packages.