Skip to content

Commit

Permalink
add funcorder linter (cadence-workflow#4939)
Browse files Browse the repository at this point in the history
  • Loading branch information
shijiesheng authored Aug 11, 2022
1 parent 385c1c3 commit b21f34f
Show file tree
Hide file tree
Showing 7 changed files with 600 additions and 432 deletions.
190 changes: 95 additions & 95 deletions client/frontend/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ func NewClient(
}
}

func (c *clientImpl) CountWorkflowExecutions(
ctx context.Context,
request *types.CountWorkflowExecutionsRequest,
opts ...yarpc.CallOption,
) (*types.CountWorkflowExecutionsResponse, error) {

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

func (c *clientImpl) DeprecateDomain(
ctx context.Context,
request *types.DeprecateDomainRequest,
Expand Down Expand Up @@ -90,6 +101,38 @@ func (c *clientImpl) DescribeTaskList(
return c.client.DescribeTaskList(ctx, request, opts...)
}

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

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

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

func (c *clientImpl) GetClusterInfo(
ctx context.Context,
opts ...yarpc.CallOption,
) (*types.ClusterInfo, error) {

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

func (c *clientImpl) GetSearchAttributes(
ctx context.Context,
opts ...yarpc.CallOption,
) (*types.GetSearchAttributesResponse, error) {

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

func (c *clientImpl) DescribeWorkflowExecution(
ctx context.Context,
request *types.DescribeWorkflowExecutionRequest,
Expand Down Expand Up @@ -123,80 +166,81 @@ func (c *clientImpl) ListArchivedWorkflowExecutions(
return c.client.ListArchivedWorkflowExecutions(ctx, request, opts...)
}

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

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

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

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

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

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

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

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

ctx, cancel := c.createContext(ctx)
defer cancel()
return c.client.ListWorkflowExecutions(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) {
) (*types.ListDomainsResponse, error) {

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

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

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

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

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

func (c *clientImpl) PollForActivityTask(
Expand Down Expand Up @@ -243,6 +287,17 @@ func (c *clientImpl) RecordActivityTaskHeartbeat(
return c.client.RecordActivityTaskHeartbeat(ctx, request, opts...)
}

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

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

func (c *clientImpl) RecordActivityTaskHeartbeatByID(
ctx context.Context,
request *types.RecordActivityTaskHeartbeatByIDRequest,
Expand Down Expand Up @@ -287,17 +342,6 @@ func (c *clientImpl) ResetStickyTaskList(
return c.client.ResetStickyTaskList(ctx, request, opts...)
}

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

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

func (c *clientImpl) RefreshWorkflowTasks(
ctx context.Context,
request *types.RefreshWorkflowTasksRequest,
Expand Down Expand Up @@ -408,16 +452,6 @@ 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) SignalWithStartWorkflowExecution(
ctx context.Context,
request *types.SignalWithStartWorkflowExecutionRequest,
Expand All @@ -440,39 +474,6 @@ func (c *clientImpl) SignalWorkflowExecution(
return c.client.SignalWorkflowExecution(ctx, request, opts...)
}

func (c *clientImpl) StartWorkflowExecution(
ctx context.Context,
request *types.StartWorkflowExecutionRequest,
opts ...yarpc.CallOption,
) (*types.StartWorkflowExecutionResponse, error) {

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

func (c *clientImpl) TerminateWorkflowExecution(
ctx context.Context,
request *types.TerminateWorkflowExecutionRequest,
opts ...yarpc.CallOption,
) error {

ctx, cancel := c.createContext(ctx)
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...)
}

func (c *clientImpl) createContext(parent context.Context) (context.Context, context.CancelFunc) {
if parent == nil {
return context.WithTimeout(context.Background(), c.timeout)
Expand All @@ -487,36 +488,35 @@ func (c *clientImpl) createLongPollContext(parent context.Context) (context.Cont
return context.WithTimeout(parent, c.longPollTimeout)
}

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

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

func (c *clientImpl) ListTaskListPartitions(
func (c *clientImpl) StartWorkflowExecution(
ctx context.Context,
request *types.ListTaskListPartitionsRequest,
request *types.StartWorkflowExecutionRequest,
opts ...yarpc.CallOption,
) (*types.ListTaskListPartitionsResponse, error) {
) (*types.StartWorkflowExecutionResponse, error) {

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

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

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

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

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

0 comments on commit b21f34f

Please sign in to comment.