usecase

package
v1.3.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateFlowRequest

type CreateFlowRequest struct {
	TenantID    string                 `json:"tenant_id"`
	Name        string                 `json:"name"`
	TriggerType spider.FlowTriggerType `json:"trigger_type"`
	Meta        map[string]string      `json:"meta,omitempty"`
	Actions     []WorkflowActionInput  `json:"actions"`
	Peers       []PeerInput            `json:"peers"`
}

type FlowDetailResponse

type FlowDetailResponse struct {
	FlowID      string                  `json:"flow_id"`
	FlowName    string                  `json:"flow_name"`
	TenantID    string                  `json:"tenant_id"`
	TriggerType spider.FlowTriggerType  `json:"trigger_type"`
	Status      spider.FlowStatus       `json:"status"`
	Version     uint64                  `json:"version"`
	Meta        map[string]string       `json:"meta,omitempty"`
	Actions     []spider.WorkflowAction `json:"actions"`
	Peers       []PeerOutput            `json:"peers"`
}

type FlowResponse

type FlowResponse struct {
	FlowID   string `json:"flow_id"`
	FlowName string `json:"flow_name"`
}

type PeerInput

type PeerInput struct {
	ParentKey  string `json:"parent_key"`
	MetaOutput string `json:"meta_output"`
	ChildKey   string `json:"child_key"`
}

type PeerOutput added in v1.3.7

type PeerOutput struct {
	ParentKey  string `json:"parent_key"`
	MetaOutput string `json:"meta_output"`
	ChildKey   string `json:"child_key"`
}

type UpdateFlowRequest

type UpdateFlowRequest struct {
	TenantID    string                 `json:"tenant_id"`
	FlowID      string                 `json:"flow_id"`
	Name        string                 `json:"name"`
	TriggerType spider.FlowTriggerType `json:"trigger_type"`
	Meta        map[string]string      `json:"meta,omitempty"`
	Status      spider.FlowStatus      `json:"status"`
	Actions     []WorkflowActionInput  `json:"actions,omitempty"`
	Peers       []PeerInput            `json:"peers,omitempty"`
}

type Usecase

type Usecase struct {
	// contains filtered or unexported fields
}

func NewUsecase

func NewUsecase(storage spider.WorkflowStorageAdapter) *Usecase

func (*Usecase) CreateFlow

func (u *Usecase) CreateFlow(ctx context.Context, req *CreateFlowRequest) (*FlowResponse, error)

func (*Usecase) DeleteFlow

func (u *Usecase) DeleteFlow(ctx context.Context, tenantID, flowID string) error

func (*Usecase) DisableAction

func (u *Usecase) DisableAction(ctx context.Context, tenantID, workflowID, key string) error

func (*Usecase) GetFlow

func (u *Usecase) GetFlow(ctx context.Context, tenantID, flowID string) (*FlowDetailResponse, error)

func (*Usecase) ListFlows

func (u *Usecase) ListFlows(ctx context.Context, tenantID string, page, pageSize int) (*spider.FlowListResponse, error)

func (*Usecase) UpdateAction

func (*Usecase) UpdateFlow

func (u *Usecase) UpdateFlow(ctx context.Context, req *UpdateFlowRequest) (*spider.Flow, error)

type WorkflowActionInput

type WorkflowActionInput struct {
	Key      string                   `json:"key"`
	ActionID string                   `json:"action_id"`
	Config   map[string]string        `json:"config"`
	Mapper   map[string]spider.Mapper `json:"mapper"`
	Meta     map[string]string        `json:"meta,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL