persist

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedToInitializeCache          = fmt.Errorf("failed to initialize cache")
	ErrReferenceProcessorNotFound       = fmt.Errorf("reference processor not found")
	ErrCouldNotRunMigrations            = fmt.Errorf("could not run migrations")
	ErrFailedToGetTotalCount            = fmt.Errorf("failed to get total count")
	ErrFailedToCreateProcessor          = fmt.Errorf("failed to create processor")
	ErrFailedToUpdateReferenceProcessor = fmt.Errorf("failed to update reference processor")
	ErrProcessorNotFound                = fmt.Errorf("processor not found")
	ErrFailedToConvertProcessors        = fmt.Errorf("failed to convert processors")
	ErrFailedToConvertTriggerProcessors = fmt.Errorf("failed to convert trigger processors")
)

Functions

func NewDBFlowManager

func NewDBFlowManager(db *gorm.DB, logFactory definitions.LoggerFactory) (definitions.FlowManager, error)

NewDBFlowManager creates a new instance of DBFlowManager with an in-memory cache for flows.

Types

type DBFlowManager

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

func (*DBFlowManager) AddProcessorToFlowAfter

func (fm *DBFlowManager) AddProcessorToFlowAfter(flowID uuid.UUID, processor *definitions.SimpleProcessor, referenceProcessorID uuid.UUID) error

AddProcessorToFlowAfter adds a processor to the flow after a reference processor.

func (*DBFlowManager) AddProcessorToFlowBefore

func (fm *DBFlowManager) AddProcessorToFlowBefore(flowID uuid.UUID, processor *definitions.SimpleProcessor, referenceProcessorID uuid.UUID) error

AddProcessorToFlowBefore adds a processor to the flow before a reference processor.

func (*DBFlowManager) GetFirstProcessorsForFlow

func (fm *DBFlowManager) GetFirstProcessorsForFlow(flowID uuid.UUID) ([]*definitions.SimpleProcessor, error)

GetFirstProcessorsForFlow retrieves the first processors in a flow.

func (*DBFlowManager) GetFlowByID

func (fm *DBFlowManager) GetFlowByID(flowID uuid.UUID) (*definitions.Flow, error)

GetFlowByID retrieves a flow by its ID, using cache if available.

func (*DBFlowManager) GetFlowProcessors

func (fm *DBFlowManager) GetFlowProcessors(flowID uuid.UUID) ([]*definitions.SimpleProcessor, error)

func (*DBFlowManager) GetLastProcessorForFlow

func (fm *DBFlowManager) GetLastProcessorForFlow(flowID uuid.UUID) ([]*definitions.SimpleProcessor, error)

GetLastProcessorForFlow retrieves the last processor(s) for a flow (no next processors).

func (*DBFlowManager) GetLastUpdateTime

func (fm *DBFlowManager) GetLastUpdateTime(flowIDs []uuid.UUID) (map[uuid.UUID]time.Time, error)

GetLastUpdateTime retrieves the last update time for the specified flow IDs.

func (*DBFlowManager) GetProcessorByID

func (fm *DBFlowManager) GetProcessorByID(flowID uuid.UUID, processorID uuid.UUID) (*definitions.SimpleProcessor, error)

GetProcessorByID retrieves a processor by its ID within a flow.

func (*DBFlowManager) GetProcessors

func (fm *DBFlowManager) GetProcessors(ids []uuid.UUID) ([]*definitions.SimpleProcessor, error)

func (*DBFlowManager) GetTriggerProcessorsForFlow

func (fm *DBFlowManager) GetTriggerProcessorsForFlow(flowID uuid.UUID) ([]*definitions.SimpleTriggerProcessor, error)

GetTriggerProcessorsForFlow retrieves the trigger processors for a given flow.

func (*DBFlowManager) ListFlows

ListFlows lists all flows with pagination and filters based on the last update time.

func (*DBFlowManager) SaveFlow

func (fm *DBFlowManager) SaveFlow(flow *definitions.Flow) error

SaveFlow saves the flow and its processors to the database.

func (*DBFlowManager) SetFlowActive

func (fm *DBFlowManager) SetFlowActive(flowID uuid.UUID, active bool) error

SetFlowActive sets the active state of a flow.

type UUIDArray added in v0.1.12

type UUIDArray []uuid.UUID

func (*UUIDArray) Scan added in v0.1.12

func (u *UUIDArray) Scan(src interface{}) error

func (UUIDArray) Value added in v0.1.12

func (u UUIDArray) Value() (driver.Value, error)

Value implements the driver.Valuer interface for UUIDArray

Jump to

Keyboard shortcuts

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