internal

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTask

func CreateTask[Data DataEntity](c Context, m Models, task *Task[Data]) error

func QueryTask

func QueryTask[Data DataEntity](c Context, m Models, task *Task[Data]) error

func QueryTaskState

func QueryTaskState(c Context, db *gorm.DB, m Models, taskID string) (*string, error)

func UpdateTask

func UpdateTask[Data DataEntity](c Context, m Models, task *Task[Data], fsm FSM[Data]) error

Types

type Base

type Base[Data DataEntity] struct {
	Config *util.Config
	Models
	db.IDB
	mq.IMQ
	FSM[Data]
	GenID func() string // ID Generator
	DEBUG bool
}

func (*Base[Data]) RegisterDB

func (b *Base[Data]) RegisterDB(db db.IDB)

func (*Base[Data]) RegisterFSM

func (b *Base[Data]) RegisterFSM(fsm FSM[Data])

func (*Base[Data]) RegisterGenerator

func (b *Base[Data]) RegisterGenerator(genID func() string)

func (*Base[Data]) RegisterMQ

func (b *Base[Data]) RegisterMQ(mq mq.IMQ)

func (*Base[Data]) RegisterModel

func (b *Base[Data]) RegisterModel(dataModel DataEntity, taskModel, uniqueRequestModel schema.Tabler)

type IBase

type IBase[Data DataEntity] interface {
	RegisterModel(dataModel DataEntity, taskModel, uniqueRequestModel schema.Tabler)
	RegisterDB(db db.IDB)
	RegisterMQ(mq mq.IMQ)
	RegisterFSM(fsm FSM[Data])
	RegisterGenerator(genID func() string)
}

Jump to

Keyboard shortcuts

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