golang

package module
v0.0.0-...-126a8ba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2025 License: MIT Imports: 4 Imported by: 0

README

Golang Starter

Build your Temporal application in Go (docs)

Overview

[!IMPORTANT] Make sure you have followed the instructions to configure your development environment before reading this section.

This repository is designed to be a quick-start for your Go Temporal application. It is designed to be quick and easy to get started, rather than any example of best practice.

This starter application consists of two parts:

  • worker: this is where you define your workflow and contains the main business logic for your Temporal application.
  • starter: this is how your trigger your workflow with any input variables and where you await the response.

Quick start

Install Air to allow live reloading your long-running applications. This is installed automatically if you use have followed the instructions to configure your development environment.

Workflow
cd golang
air

The workflow is a long-running application. For rapid development, the recommendation is to use Air.

You can also run this with go run ./worker and restarting after every code change.

Starter
cd golang
go run ./starter

The starter will usually be something that runs to completion.

Design considerations

Activity dependency injection

The activities are functions on a struct. This is done so that external dependencies (eg, a database connection) can be injected in. This allows for the connection to be verified at run-time and used when a call is made. This avoids having to create the dependency when an activity is received, which may fail.

Documentation

Index

Constants

View Source
const TASK_QUEUE_NAME = "hackathon"

Variables

This section is empty.

Functions

func HelloWorldWorkflow

func HelloWorldWorkflow(ctx workflow.Context, name string) (string, error)

func NewActivities

func NewActivities() (*activities, error)

If you need to inject dependencies, pass them in here The error response can be useful

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL