scheduler

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Persistence

type Persistence interface {
	GetAll() ([]model.ScheduleEntry, error)
	Set(entry model.ScheduleEntry) error
	Get(id string, userId string) (model.ScheduleEntry, error)
	Remove(id string, user string) error
	List(user string, createdBy *string) ([]model.ScheduleEntry, error)
}

type ProcessApi

type ProcessApi interface {
	Execute(entry model.ScheduleEntry)
}

type Scheduler

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

func New

func New(persistence Persistence, processes ProcessApi) *Scheduler

func (*Scheduler) Add

func (this *Scheduler) Add(entry model.ScheduleEntry, user string) (result model.ScheduleEntry, err error, code int)

func (*Scheduler) Delete

func (this *Scheduler) Delete(id string, user string) (err error, code int)

func (*Scheduler) List

func (this *Scheduler) List(user string, createdBy *string) (result []model.ScheduleEntry, err error, code int)

func (*Scheduler) Start

func (this *Scheduler) Start(ctx context.Context, wg *sync.WaitGroup) error

func (*Scheduler) Stop

func (this *Scheduler) Stop()

func (*Scheduler) Update

func (this *Scheduler) Update(entry model.ScheduleEntry, user string) (result model.ScheduleEntry, err error, code int)

Jump to

Keyboard shortcuts

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