Documentation ¶
Index ¶
- func AssignJobsToPartition(ctx context.Context, db IDB, target int, limit int) error
- func GetScheduledJob(ctx context.Context, db IDB, id string, userId int64) (entities.ScheduledJob, error)
- func GetUserByApiKey(ctx context.Context, db IDB, apiKey string) (entities.User, error)
- func GetUserByUserName(ctx context.Context, db IDB, username string) (entities.User, error)
- func InsertExecution(ctx context.Context, db IDB, job entities.Execution) (entities.Execution, error)
- func InsertScheduledJob(ctx context.Context, db IDB, job entities.ScheduledJob) (entities.ScheduledJob, error)
- func InsertUser(ctx context.Context, db IDB, u entities.User) (entities.User, error)
- func Notify(ctx context.Context, db IDB, payload any) error
- func ReBalance(ctx context.Context, db IDB, active []int) error
- func RemovesJobsFromPartition(ctx context.Context, db IDB, current int, limit int) error
- func SelectExecutions(ctx context.Context, db IDB, jobID int64) ([]entities.Execution, error)
- func SelectJobsForExecution(ctx context.Context, db *DB, partition int, limit int, now time.Time) ([]entities.ScheduledJob, entities.ScheduledJob, error)
- func ToEntitiesExecution(e Execution) entities.Execution
- func ToEntitiesUser(u User) entities.User
- func ToScheduledJobEntity(j ScheduledJob) entities.ScheduledJob
- func UpdateJobStatus(ctx context.Context, db IDB, job entities.ScheduledJob) error
- func UpdateJobsPartitions(ctx context.Context, db IDB, active []int, target int) error
- func UpdateScheduledJobsPartitions(ctx context.Context, db IDB, job entities.ScheduledJob) error
- func UserExists(ctx context.Context, db IDB, username string) (bool, error)
- type DB
- type DbConfig
- type Execution
- type IDB
- type ScheduledJob
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignJobsToPartition ¶
func GetScheduledJob ¶
func GetUserByApiKey ¶
func GetUserByUserName ¶
func InsertExecution ¶
func InsertScheduledJob ¶
func InsertScheduledJob(ctx context.Context, db IDB, job entities.ScheduledJob) (entities.ScheduledJob, error)
func InsertUser ¶
func SelectExecutions ¶
func SelectJobsForExecution ¶
func ToEntitiesExecution ¶
func ToEntitiesUser ¶
func ToScheduledJobEntity ¶
func ToScheduledJobEntity(j ScheduledJob) entities.ScheduledJob
func UpdateJobStatus ¶
func UpdateJobsPartitions ¶
Types ¶
type Execution ¶
type Execution struct { bun.BaseModel ID int64 `bun:"id,pk,autoincrement"` ScheduledJobID int64 `bun:"scheduled_job_id"` StatusCode int Msg string CreatedAt time.Time }
func FromEntitiesExecution ¶
type ScheduledJob ¶
type ScheduledJob struct { bun.BaseModel ID int64 `bun:"id,pk,autoincrement"` UID uuid.UUID UserID int64 Name string Description string Url string Payload string ContentType string Signature string RunAt time.Time Retries int Status int Partition int CreatedAt time.Time UpdatedAt bun.NullTime }
func FromScheduledJobEntity ¶
func FromScheduledJobEntity(j entities.ScheduledJob) ScheduledJob
Click to show internal directories.
Click to hide internal directories.