Skip to content

Commit

Permalink
fix funcorder linter (cadence-workflow#4942)
Browse files Browse the repository at this point in the history
* fix funcorder linter

* lint

Co-authored-by: David Porter <[email protected]>
  • Loading branch information
shijiesheng and davidporter-id-au authored Aug 16, 2022
1 parent d1965b1 commit 7566018
Show file tree
Hide file tree
Showing 4 changed files with 333 additions and 321 deletions.
140 changes: 70 additions & 70 deletions client/frontend/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,15 @@ func (c *clientImpl) DescribeTaskList(
return c.client.DescribeTaskList(ctx, request, opts...)
}

func (c *clientImpl) GetTaskListsByDomain(
func (c *clientImpl) DescribeWorkflowExecution(
ctx context.Context,
request *types.GetTaskListsByDomainRequest,
request *types.DescribeWorkflowExecutionRequest,
opts ...yarpc.CallOption,
) (*types.GetTaskListsByDomainResponse, error) {
) (*types.DescribeWorkflowExecutionResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()

return c.client.GetTaskListsByDomain(ctx, request, opts...)
return c.client.DescribeWorkflowExecution(ctx, request, opts...)
}

func (c *clientImpl) GetClusterInfo(
Expand All @@ -133,15 +132,16 @@ func (c *clientImpl) GetSearchAttributes(
return c.client.GetSearchAttributes(ctx, opts...)
}

func (c *clientImpl) DescribeWorkflowExecution(
func (c *clientImpl) GetTaskListsByDomain(
ctx context.Context,
request *types.DescribeWorkflowExecutionRequest,
request *types.GetTaskListsByDomainRequest,
opts ...yarpc.CallOption,
) (*types.DescribeWorkflowExecutionResponse, error) {
) (*types.GetTaskListsByDomainResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.DescribeWorkflowExecution(ctx, request, opts...)

return c.client.GetTaskListsByDomain(ctx, request, opts...)
}

func (c *clientImpl) GetWorkflowExecutionHistory(
Expand All @@ -166,59 +166,49 @@ func (c *clientImpl) ListArchivedWorkflowExecutions(
return c.client.ListArchivedWorkflowExecutions(ctx, request, opts...)
}

func (c *clientImpl) ListTaskListPartitions(
func (c *clientImpl) ListClosedWorkflowExecutions(
ctx context.Context,
request *types.ListTaskListPartitionsRequest,
request *types.ListClosedWorkflowExecutionsRequest,
opts ...yarpc.CallOption,
) (*types.ListTaskListPartitionsResponse, error) {
) (*types.ListClosedWorkflowExecutionsResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()

return c.client.ListTaskListPartitions(ctx, request, opts...)
return c.client.ListClosedWorkflowExecutions(ctx, request, opts...)
}

func (c *clientImpl) ScanWorkflowExecutions(
func (c *clientImpl) ListDomains(
ctx context.Context,
request *types.ListWorkflowExecutionsRequest,
request *types.ListDomainsRequest,
opts ...yarpc.CallOption,
) (*types.ListWorkflowExecutionsResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.ScanWorkflowExecutions(ctx, request, opts...)
}

func (c *clientImpl) RestartWorkflowExecution(
ctx context.Context,
request *types.RestartWorkflowExecutionRequest,
opts ...yarpc.CallOption) (*types.RestartWorkflowExecutionResponse, error) {
) (*types.ListDomainsResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.RestartWorkflowExecution(ctx, request, opts...)
return c.client.ListDomains(ctx, request, opts...)
}

func (c *clientImpl) ListClosedWorkflowExecutions(
func (c *clientImpl) ListOpenWorkflowExecutions(
ctx context.Context,
request *types.ListClosedWorkflowExecutionsRequest,
request *types.ListOpenWorkflowExecutionsRequest,
opts ...yarpc.CallOption,
) (*types.ListClosedWorkflowExecutionsResponse, error) {
) (*types.ListOpenWorkflowExecutionsResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.ListClosedWorkflowExecutions(ctx, request, opts...)
return c.client.ListOpenWorkflowExecutions(ctx, request, opts...)
}

func (c *clientImpl) ListDomains(
func (c *clientImpl) ListTaskListPartitions(
ctx context.Context,
request *types.ListDomainsRequest,
request *types.ListTaskListPartitionsRequest,
opts ...yarpc.CallOption,
) (*types.ListDomainsResponse, error) {
) (*types.ListTaskListPartitionsResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.ListDomains(ctx, request, opts...)

return c.client.ListTaskListPartitions(ctx, request, opts...)
}

func (c *clientImpl) ListWorkflowExecutions(
Expand All @@ -232,17 +222,6 @@ func (c *clientImpl) ListWorkflowExecutions(
return c.client.ListWorkflowExecutions(ctx, request, opts...)
}

func (c *clientImpl) ListOpenWorkflowExecutions(
ctx context.Context,
request *types.ListOpenWorkflowExecutionsRequest,
opts ...yarpc.CallOption,
) (*types.ListOpenWorkflowExecutionsResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.ListOpenWorkflowExecutions(ctx, request, opts...)
}

func (c *clientImpl) PollForActivityTask(
ctx context.Context,
request *types.PollForActivityTaskRequest,
Expand Down Expand Up @@ -287,26 +266,26 @@ func (c *clientImpl) RecordActivityTaskHeartbeat(
return c.client.RecordActivityTaskHeartbeat(ctx, request, opts...)
}

func (c *clientImpl) ResetWorkflowExecution(
func (c *clientImpl) RecordActivityTaskHeartbeatByID(
ctx context.Context,
request *types.ResetWorkflowExecutionRequest,
request *types.RecordActivityTaskHeartbeatByIDRequest,
opts ...yarpc.CallOption,
) (*types.ResetWorkflowExecutionResponse, error) {
) (*types.RecordActivityTaskHeartbeatResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.ResetWorkflowExecution(ctx, request, opts...)
return c.client.RecordActivityTaskHeartbeatByID(ctx, request, opts...)
}

func (c *clientImpl) RecordActivityTaskHeartbeatByID(
func (c *clientImpl) RefreshWorkflowTasks(
ctx context.Context,
request *types.RecordActivityTaskHeartbeatByIDRequest,
request *types.RefreshWorkflowTasksRequest,
opts ...yarpc.CallOption,
) (*types.RecordActivityTaskHeartbeatResponse, error) {
) error {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.RecordActivityTaskHeartbeatByID(ctx, request, opts...)
return c.client.RefreshWorkflowTasks(ctx, request, opts...)
}

func (c *clientImpl) RegisterDomain(
Expand Down Expand Up @@ -342,15 +321,15 @@ func (c *clientImpl) ResetStickyTaskList(
return c.client.ResetStickyTaskList(ctx, request, opts...)
}

func (c *clientImpl) RefreshWorkflowTasks(
func (c *clientImpl) ResetWorkflowExecution(
ctx context.Context,
request *types.RefreshWorkflowTasksRequest,
request *types.ResetWorkflowExecutionRequest,
opts ...yarpc.CallOption,
) error {
) (*types.ResetWorkflowExecutionResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.RefreshWorkflowTasks(ctx, request, opts...)
return c.client.ResetWorkflowExecution(ctx, request, opts...)
}

func (c *clientImpl) RespondActivityTaskCanceled(
Expand Down Expand Up @@ -452,6 +431,27 @@ func (c *clientImpl) RespondQueryTaskCompleted(
return c.client.RespondQueryTaskCompleted(ctx, request, opts...)
}

func (c *clientImpl) RestartWorkflowExecution(
ctx context.Context,
request *types.RestartWorkflowExecutionRequest,
opts ...yarpc.CallOption) (*types.RestartWorkflowExecutionResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.RestartWorkflowExecution(ctx, request, opts...)
}

func (c *clientImpl) ScanWorkflowExecutions(
ctx context.Context,
request *types.ListWorkflowExecutionsRequest,
opts ...yarpc.CallOption,
) (*types.ListWorkflowExecutionsResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.ScanWorkflowExecutions(ctx, request, opts...)
}

func (c *clientImpl) SignalWithStartWorkflowExecution(
ctx context.Context,
request *types.SignalWithStartWorkflowExecutionRequest,
Expand Down Expand Up @@ -488,17 +488,6 @@ func (c *clientImpl) createLongPollContext(parent context.Context) (context.Cont
return context.WithTimeout(parent, c.longPollTimeout)
}

func (c *clientImpl) UpdateDomain(
ctx context.Context,
request *types.UpdateDomainRequest,
opts ...yarpc.CallOption,
) (*types.UpdateDomainResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.UpdateDomain(ctx, request, opts...)
}

func (c *clientImpl) StartWorkflowExecution(
ctx context.Context,
request *types.StartWorkflowExecutionRequest,
Expand All @@ -520,3 +509,14 @@ func (c *clientImpl) TerminateWorkflowExecution(
defer cancel()
return c.client.TerminateWorkflowExecution(ctx, request, opts...)
}

func (c *clientImpl) UpdateDomain(
ctx context.Context,
request *types.UpdateDomainRequest,
opts ...yarpc.CallOption,
) (*types.UpdateDomainResponse, error) {

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.UpdateDomain(ctx, request, opts...)
}
Loading

0 comments on commit 7566018

Please sign in to comment.