Documentation
¶
Index ¶
- func SanitizeString(input string) string
- type FileInfo
- type Runner
- type RunnerImpl
- type RunnerMock
- type StartWorklfowRequest
- type StepContext
- type Workflow
- type WorkflowAction
- type WorkflowAutofillPayload
- type WorkflowCreateColumnParams
- type WorkflowCreateTablePayload
- type WorkflowDeleteColumnParams
- type WorkflowDeleteTableParams
- type WorkflowExportTableParams
- type WorkflowGeneratePayload
- type WorkflowImportFileParams
- type WorkflowService
- type WorkflowServiceImpl
- func (w *WorkflowServiceImpl) Create(ctx context.Context, wf *Workflow) (string, error)
- func (w *WorkflowServiceImpl) Delete(ctx context.Context, wf string) error
- func (w *WorkflowServiceImpl) Get(ctx context.Context, wf string) (*ent.Workflow, error)
- func (w *WorkflowServiceImpl) List(ctx context.Context) ([]*ent.Workflow, error)
- func (w *WorkflowServiceImpl) Start(ctx context.Context, id string, request StartWorklfowRequest) (Runner, error)
- func (w *WorkflowServiceImpl) Update(ctx context.Context, id string, wf *Workflow) (string, error)
- type WorkflowServiceMock
- func (mock *WorkflowServiceMock) Create(ctx context.Context, wf *Workflow) (string, error)
- func (mock *WorkflowServiceMock) CreateCalls() []struct{ ... }
- func (mock *WorkflowServiceMock) Delete(ctx context.Context, wf string) error
- func (mock *WorkflowServiceMock) DeleteCalls() []struct{ ... }
- func (mock *WorkflowServiceMock) Get(ctx context.Context, wf string) (*ent.Workflow, error)
- func (mock *WorkflowServiceMock) GetCalls() []struct{ ... }
- func (mock *WorkflowServiceMock) List(ctx context.Context) ([]*ent.Workflow, error)
- func (mock *WorkflowServiceMock) ListCalls() []struct{ ... }
- func (mock *WorkflowServiceMock) Start(ctx context.Context, id string, request StartWorklfowRequest) (Runner, error)
- func (mock *WorkflowServiceMock) StartCalls() []struct{ ... }
- func (mock *WorkflowServiceMock) Update(ctx context.Context, id string, wf *Workflow) (string, error)
- func (mock *WorkflowServiceMock) UpdateCalls() []struct{ ... }
- type WorkflowSimple
- type WorkflowStepResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SanitizeString ¶
Types ¶
type RunnerImpl ¶
type RunnerImpl struct {
// contains filtered or unexported fields
}
func (*RunnerImpl) Next ¶
func (r *RunnerImpl) Next(ctx context.Context) (*WorkflowStepResult, error)
type RunnerMock ¶
type RunnerMock struct {
// NextFunc mocks the Next method.
NextFunc func(ctx context.Context) (*WorkflowStepResult, error)
// contains filtered or unexported fields
}
RunnerMock is a mock implementation of Runner.
func TestSomethingThatUsesRunner(t *testing.T) {
// make and configure a mocked Runner
mockedRunner := &RunnerMock{
NextFunc: func(ctx context.Context) (*WorkflowStepResult, error) {
panic("mock out the Next method")
},
}
// use mockedRunner in code that requires Runner
// and then make assertions.
}
func (*RunnerMock) Next ¶
func (mock *RunnerMock) Next(ctx context.Context) (*WorkflowStepResult, error)
Next calls NextFunc.
func (*RunnerMock) NextCalls ¶
func (mock *RunnerMock) NextCalls() []struct { Ctx context.Context }
NextCalls gets all the calls that were made to Next. Check the length with:
len(mockedRunner.NextCalls())
type StartWorklfowRequest ¶
type StepContext ¶
func (StepContext) AsMap ¶
func (s StepContext) AsMap() map[string]string
type Workflow ¶
type Workflow struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Variables []schema.WorkflowVariable `json:"variables"`
Steps []schema.WorkflowStep `json:"steps"`
}
type WorkflowAction ¶
type WorkflowAction string
const ( WorkflowActionShowMessage WorkflowAction = "ShowMessage" WorkflowActionGenerate WorkflowAction = "Genetate" WorkflowActionExport WorkflowAction = "Export" )
type WorkflowAutofillPayload ¶
type WorkflowCreateTablePayload ¶
type WorkflowCreateTablePayload struct {
SchemaFile string `json:"schema_file"`
OnExists schema.WorkflowTableOnExists `json:"on_exists"`
Request table.TableGenRequest `json:"request"`
Datasets []string `json:"datasets"`
}
type WorkflowDeleteTableParams ¶
type WorkflowDeleteTableParams struct {
Table string `json:"table"`
}
type WorkflowGeneratePayload ¶
type WorkflowService ¶
type WorkflowService interface {
Get(ctx context.Context, wf string) (*ent.Workflow, error)
Delete(ctx context.Context, wf string) error
Create(ctx context.Context, wf *Workflow) (string, error)
Update(ctx context.Context, id string, wf *Workflow) (string, error)
Start(ctx context.Context, id string, request StartWorklfowRequest) (Runner, error)
List(ctx context.Context) ([]*ent.Workflow, error)
}
type WorkflowServiceImpl ¶
type WorkflowServiceImpl struct {
// contains filtered or unexported fields
}
func NewWorkflowService ¶
func NewWorkflowService(db *ent.Client, table table.TableService) *WorkflowServiceImpl
func (*WorkflowServiceImpl) Delete ¶
func (w *WorkflowServiceImpl) Delete(ctx context.Context, wf string) error
func (*WorkflowServiceImpl) Start ¶
func (w *WorkflowServiceImpl) Start(ctx context.Context, id string, request StartWorklfowRequest) (Runner, error)
type WorkflowServiceMock ¶
type WorkflowServiceMock struct {
// CreateFunc mocks the Create method.
CreateFunc func(ctx context.Context, wf *Workflow) (string, error)
// DeleteFunc mocks the Delete method.
DeleteFunc func(ctx context.Context, wf string) error
// GetFunc mocks the Get method.
GetFunc func(ctx context.Context, wf string) (*ent.Workflow, error)
// ListFunc mocks the List method.
ListFunc func(ctx context.Context) ([]*ent.Workflow, error)
// StartFunc mocks the Start method.
StartFunc func(ctx context.Context, id string, request StartWorklfowRequest) (Runner, error)
// UpdateFunc mocks the Update method.
UpdateFunc func(ctx context.Context, id string, wf *Workflow) (string, error)
// contains filtered or unexported fields
}
WorkflowServiceMock is a mock implementation of WorkflowService.
func TestSomethingThatUsesWorkflowService(t *testing.T) {
// make and configure a mocked WorkflowService
mockedWorkflowService := &WorkflowServiceMock{
CreateFunc: func(ctx context.Context, wf *Workflow) (string, error) {
panic("mock out the Create method")
},
DeleteFunc: func(ctx context.Context, wf string) error {
panic("mock out the Delete method")
},
GetFunc: func(ctx context.Context, wf string) (*ent.Workflow, error) {
panic("mock out the Get method")
},
ListFunc: func(ctx context.Context) ([]*ent.Workflow, error) {
panic("mock out the List method")
},
StartFunc: func(ctx context.Context, id string, request StartWorklfowRequest) (Runner, error) {
panic("mock out the Start method")
},
UpdateFunc: func(ctx context.Context, id string, wf *Workflow) (string, error) {
panic("mock out the Update method")
},
}
// use mockedWorkflowService in code that requires WorkflowService
// and then make assertions.
}
func (*WorkflowServiceMock) CreateCalls ¶
func (mock *WorkflowServiceMock) CreateCalls() []struct { Ctx context.Context Wf *Workflow }
CreateCalls gets all the calls that were made to Create. Check the length with:
len(mockedWorkflowService.CreateCalls())
func (*WorkflowServiceMock) Delete ¶
func (mock *WorkflowServiceMock) Delete(ctx context.Context, wf string) error
Delete calls DeleteFunc.
func (*WorkflowServiceMock) DeleteCalls ¶
func (mock *WorkflowServiceMock) DeleteCalls() []struct { Ctx context.Context Wf string }
DeleteCalls gets all the calls that were made to Delete. Check the length with:
len(mockedWorkflowService.DeleteCalls())
func (*WorkflowServiceMock) GetCalls ¶
func (mock *WorkflowServiceMock) GetCalls() []struct { Ctx context.Context Wf string }
GetCalls gets all the calls that were made to Get. Check the length with:
len(mockedWorkflowService.GetCalls())
func (*WorkflowServiceMock) ListCalls ¶
func (mock *WorkflowServiceMock) ListCalls() []struct { Ctx context.Context }
ListCalls gets all the calls that were made to List. Check the length with:
len(mockedWorkflowService.ListCalls())
func (*WorkflowServiceMock) Start ¶
func (mock *WorkflowServiceMock) Start(ctx context.Context, id string, request StartWorklfowRequest) (Runner, error)
Start calls StartFunc.
func (*WorkflowServiceMock) StartCalls ¶
func (mock *WorkflowServiceMock) StartCalls() []struct { Ctx context.Context ID string Request StartWorklfowRequest }
StartCalls gets all the calls that were made to Start. Check the length with:
len(mockedWorkflowService.StartCalls())
func (*WorkflowServiceMock) Update ¶
func (mock *WorkflowServiceMock) Update(ctx context.Context, id string, wf *Workflow) (string, error)
Update calls UpdateFunc.
func (*WorkflowServiceMock) UpdateCalls ¶
func (mock *WorkflowServiceMock) UpdateCalls() []struct { Ctx context.Context ID string Wf *Workflow }
UpdateCalls gets all the calls that were made to Update. Check the length with:
len(mockedWorkflowService.UpdateCalls())
type WorkflowSimple ¶
type WorkflowStepResult ¶
type WorkflowStepResult struct {
Action WorkflowAction
Message string
ExportData string
ExportPath string
Generator table.RowsGenerator
}