Skip to content

Commit afb05cb

Browse files
committed
Remove WorkflowMetadata alias
Signed-off-by: joshvanl <[email protected]>
1 parent a4b2ecd commit afb05cb

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

workflow/api.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ type TerminateOptions api.TerminateOptions
1414
type PurgeOptions api.PurgeOptions
1515
type RerunOptions api.RerunOptions
1616

17-
type WorkflowMetadata WorkflowState
18-
1917
// WithInstanceID configures an explicit workflow instance ID. If not
2018
// specified, a random UUID value will be used for the workflow instance ID.
2119
func WithInstanceID(id string) NewWorkflowOptions {
@@ -85,11 +83,11 @@ func WithRecursivePurge(recursive bool) PurgeOptions {
8583
}
8684

8785
func WorkflowMetadataIsRunning(o *WorkflowMetadata) bool {
88-
return api.OrchestrationMetadataIsComplete(o.Metadata)
86+
return api.OrchestrationMetadataIsComplete(o.metadata)
8987
}
9088

9189
func WorkflowMetadataIsComplete(o *WorkflowMetadata) bool {
92-
return api.OrchestrationMetadataIsComplete(o.Metadata)
90+
return api.OrchestrationMetadataIsComplete(o.metadata)
9391
}
9492

9593
func WithRerunInput(input any) RerunOptions {

workflow/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (c *Client) FetchWorkflowMetadata(ctx context.Context, id string, opts ...F
5353
oops[i] = api.FetchOrchestrationMetadataOptions(o)
5454
}
5555
meta, err := c.thgc.FetchOrchestrationMetadata(ctx, api.InstanceID(id), oops...)
56-
return &WorkflowMetadata{Metadata: meta}, err
56+
return &WorkflowMetadata{metadata: meta}, err
5757
}
5858

5959
// WaitForWorkflowStart waits for an workflow to start running and returns an

workflow/state.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,20 @@ func (s Status) RuntimeStatus() api.OrchestrationStatus {
5959
return -1
6060
}
6161

62-
type WorkflowState struct {
63-
Metadata *backend.OrchestrationMetadata
62+
type WorkflowMetadata struct {
63+
metadata *backend.OrchestrationMetadata
6464
}
6565

6666
// RuntimeStatus returns the status from a workflow state.
67-
func (wfs *WorkflowState) RuntimeStatus() Status {
68-
s := Status(wfs.Metadata.GetRuntimeStatus().Number())
67+
func (w *WorkflowMetadata) RuntimeStatus() Status {
68+
s := Status(w.metadata.GetRuntimeStatus().Number())
6969
return s
7070
}
7171

72+
func (w *WorkflowMetadata) Metadata() *backend.OrchestrationMetadata {
73+
return w.metadata
74+
}
75+
7276
func convertStatusSlice(ss []Status) []api.OrchestrationStatus {
7377
out := []api.OrchestrationStatus{}
7478
for _, s := range ss {

0 commit comments

Comments
 (0)