Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyExists = errors.New("already exists") ErrAlreadyCompleted = errors.New("already completed") )
Functions ¶
This section is empty.
Types ¶
type Controller ¶
func NewController ¶
func NewController(s Service) Controller
type EventHandler ¶
type EventHandler interface { OnEventAdd(event *corev1.Event) OnCronJobDelete(cronJob *batchv1.CronJob) }
func NewEventHandler ¶
func NewEventHandler(s Service, h events.Hub, cronJobLister v1.CronJobLister, jobLister v1.JobLister) EventHandler
type Repository ¶
type Repository interface { Add(ctx context.Context, j Job) (bool, error) List(ctx context.Context) ([]Job, error) CompleteByID(ctx context.Context, id string, s Status, t time.Time) (bool, error) DeleteByCronJobID(ctx context.Context, cronJobID string) error FindByID(ctx context.Context, id string) (*Job, error) }
func NewRepository ¶
func NewRepository(db *sql.DB) Repository
type Service ¶
type Service interface { Create(ctx context.Context, id string, cronJobID string, t time.Time) (*Job, error) Succeed(ctx context.Context, id string, t time.Time) (*Job, error) Fail(ctx context.Context, id string, t time.Time) (*Job, error) List(ctx context.Context) ([]Job, error) Delete(ctx context.Context, cronJobID string) error }
func NewService ¶
func NewService(r Repository) Service
Click to show internal directories.
Click to hide internal directories.