-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/go_modules/go.temporal.io/api-1.26.1
- Loading branch information
Showing
11 changed files
with
199 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package trace | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/temporalio/cli/common" | ||
"github.com/temporalio/tctl-kit/pkg/output" | ||
"github.com/urfave/cli/v2" | ||
sdkclient "go.temporal.io/sdk/client" | ||
) | ||
|
||
type Row struct { | ||
Key string | ||
Value string | ||
} | ||
|
||
func PrintWorkflowSummary(c *cli.Context, sdkClient sdkclient.Client, wfId, runId string) error { | ||
tcCtx, cancel := common.NewIndefiniteContext(c) | ||
defer cancel() | ||
|
||
res, err := sdkClient.DescribeWorkflowExecution(tcCtx, wfId, runId) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
info := res.GetWorkflowExecutionInfo() | ||
|
||
_, _ = title.Println("Execution summary:") | ||
rows := []Row{ | ||
{"Workflow Id", info.GetExecution().GetWorkflowId()}, | ||
{"Workflow Run Id", info.GetExecution().GetRunId()}, | ||
{"Workflow Type", info.GetType().GetName()}, | ||
{"Task Queue", info.GetTaskQueue()}, | ||
} | ||
var i []interface{} | ||
for _, row := range rows { | ||
i = append(i, row) | ||
} | ||
|
||
err = output.PrintItems(c, i, | ||
&output.PrintOptions{ | ||
Fields: []string{"Key", "Value"}, | ||
NoHeader: true, | ||
}, | ||
) | ||
_, _ = fmt.Println() | ||
|
||
return err | ||
} |
Oops, something went wrong.