Introduce a commercial license option alongside AGPL-3.0-only, require a CLA for contributors, and document the terms in COMMERCIAL.md and NOTICE. Add a script to stamp SPDX headers on Go files and apply it across the tree.
39 lines
1.0 KiB
Go
39 lines
1.0 KiB
Go
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
// SPDX-FileCopyrightText: 2025-2026 Christian Galo
|
|
|
|
package example
|
|
|
|
import (
|
|
"git.coopcloud.tech/wiki-cafe/member-console/internal/workflows/common"
|
|
"go.temporal.io/sdk/workflow"
|
|
)
|
|
|
|
type Input struct {
|
|
Message string
|
|
}
|
|
|
|
type Output struct {
|
|
Result string
|
|
}
|
|
|
|
// Workflow is the entry point for the example domain workflow.
|
|
func Workflow(ctx workflow.Context, input Input) (*Output, error) {
|
|
logger := workflow.GetLogger(ctx)
|
|
logger.Info("ExampleWorkflow started", "message", input.Message)
|
|
|
|
// Apply activity options
|
|
ctx = workflow.WithActivityOptions(ctx, common.DefaultActivityOptions())
|
|
|
|
// Execute activity
|
|
var activities *Activities // Pointer to the struct to get method names
|
|
var result string
|
|
err := workflow.ExecuteActivity(ctx, activities.ExampleActivity, input.Message).Get(ctx, &result)
|
|
if err != nil {
|
|
logger.Error("Activity failed", "error", err)
|
|
return nil, err
|
|
}
|
|
|
|
logger.Info("ExampleWorkflow completed", "result", result)
|
|
return &Output{Result: result}, nil
|
|
}
|