schedule

package
v0.0.0-...-0485310 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetScheduleService

func GetScheduleService() (res interfaces.ScheduleService, err error)

func NewLogger

func NewLogger() cron.Logger

func NewScheduleService

func NewScheduleService() (svc2 interfaces.ScheduleService, err error)

Types

type Logger

type Logger struct {
}

func (*Logger) Error

func (l *Logger) Error(err error, msg string, keysAndValues ...interface{})

func (*Logger) Info

func (l *Logger) Info(msg string, keysAndValues ...interface{})

type Option

type Option func(svc interfaces.ScheduleService)

func WithConfigPath

func WithConfigPath(path string) Option

func WithDelayIfStillRunning

func WithDelayIfStillRunning() Option

func WithLocation

func WithLocation(loc *time.Location) Option

func WithSkipIfStillRunning

func WithSkipIfStillRunning() Option

func WithUpdateInterval

func WithUpdateInterval(interval time.Duration) Option

type Service

type Service struct {
	// dependencies
	interfaces.WithConfigPath
	// contains filtered or unexported fields
}

func (*Service) Disable

func (svc *Service) Disable(s interfaces.Schedule, args ...interface{}) (err error)

func (*Service) Enable

func (svc *Service) Enable(s interfaces.Schedule, args ...interface{}) (err error)

func (*Service) GetCron

func (svc *Service) GetCron() (c *cron.Cron)

func (*Service) GetDelay

func (svc *Service) GetDelay() (delay bool)

func (*Service) GetLocation

func (svc *Service) GetLocation() (loc *time.Location)

func (*Service) GetSkip

func (svc *Service) GetSkip() (skip bool)

func (*Service) GetUpdateInterval

func (svc *Service) GetUpdateInterval() (interval time.Duration)

func (*Service) Init

func (svc *Service) Init() (err error)

func (*Service) SetDelay

func (svc *Service) SetDelay(delay bool)

func (*Service) SetLocation

func (svc *Service) SetLocation(loc *time.Location)

func (*Service) SetSkip

func (svc *Service) SetSkip(skip bool)

func (*Service) SetUpdateInterval

func (svc *Service) SetUpdateInterval(interval time.Duration)

func (*Service) Start

func (svc *Service) Start()

func (*Service) Stop

func (svc *Service) Stop()

func (*Service) Update

func (svc *Service) Update()

func (*Service) Wait

func (svc *Service) Wait()

type ServiceV2

type ServiceV2 struct {
	// dependencies
	interfaces.WithConfigPath
	// contains filtered or unexported fields
}

func GetScheduleServiceV2

func GetScheduleServiceV2() (res *ServiceV2, err error)

func NewScheduleServiceV2

func NewScheduleServiceV2() (svc2 *ServiceV2, err error)

func (*ServiceV2) Disable

func (svc *ServiceV2) Disable(s models2.ScheduleV2, by primitive.ObjectID) (err error)

func (*ServiceV2) Enable

func (svc *ServiceV2) Enable(s models2.ScheduleV2, by primitive.ObjectID) (err error)

func (*ServiceV2) GetCron

func (svc *ServiceV2) GetCron() (c *cron.Cron)

func (*ServiceV2) GetDelay

func (svc *ServiceV2) GetDelay() (delay bool)

func (*ServiceV2) GetLocation

func (svc *ServiceV2) GetLocation() (loc *time.Location)

func (*ServiceV2) GetSkip

func (svc *ServiceV2) GetSkip() (skip bool)

func (*ServiceV2) GetUpdateInterval

func (svc *ServiceV2) GetUpdateInterval() (interval time.Duration)

func (*ServiceV2) Init

func (svc *ServiceV2) Init() (err error)

func (*ServiceV2) SetDelay

func (svc *ServiceV2) SetDelay(delay bool)

func (*ServiceV2) SetLocation

func (svc *ServiceV2) SetLocation(loc *time.Location)

func (*ServiceV2) SetSkip

func (svc *ServiceV2) SetSkip(skip bool)

func (*ServiceV2) SetUpdateInterval

func (svc *ServiceV2) SetUpdateInterval(interval time.Duration)

func (*ServiceV2) Start

func (svc *ServiceV2) Start()

func (*ServiceV2) Stop

func (svc *ServiceV2) Stop()

func (*ServiceV2) Update

func (svc *ServiceV2) Update()

func (*ServiceV2) Wait

func (svc *ServiceV2) Wait()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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