Help us shape the future of Go! Take the 2026 Go Developer Survey

schedule

package
v1.20.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

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

func NewApplication

func NewApplication(artisan console.Artisan, cache cache.Cache, log log.Log, debug bool) *Application

func (*Application) Call

func (app *Application) Call(callback func()) schedule.Event

func (*Application) Command

func (app *Application) Command(command string) schedule.Event

func (*Application) Events

func (app *Application) Events() []schedule.Event

func (*Application) Register

func (app *Application) Register(events []schedule.Event)

func (*Application) Run

func (app *Application) Run()

func (*Application) Shutdown

func (app *Application) Shutdown(ctx ...context.Context) error

type Event

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

func NewCallbackEvent

func NewCallbackEvent(callback func()) *Event

func NewCommandEvent

func NewCommandEvent(command string) *Event

func (*Event) At

func (r *Event) At(time string) schedule.Event

At schedule the command at a given time.

func (*Event) Cron

func (r *Event) Cron(expression string) schedule.Event

Cron The Cron expression representing the event's frequency.

func (*Event) Daily

func (r *Event) Daily() schedule.Event

Daily schedule the event to run daily.

func (*Event) DailyAt

func (r *Event) DailyAt(time string) schedule.Event

DailyAt schedule the event to run daily at a given time (10:00, 19:30, etc).

func (*Event) Days

func (r *Event) Days(days ...time.Weekday) schedule.Event

Days schedule the event to run on specific days of the week.

func (*Event) DelayIfStillRunning

func (r *Event) DelayIfStillRunning() schedule.Event

DelayIfStillRunning do not allow the event to overlap each other.

func (*Event) EveryFifteenMinutes

func (r *Event) EveryFifteenMinutes() schedule.Event

EveryFifteenMinutes schedule the event to run every fifteen minutes.

func (*Event) EveryFifteenSeconds

func (r *Event) EveryFifteenSeconds() schedule.Event

EveryFifteenSeconds schedule the event to run every fifteen seconds.

func (*Event) EveryFiveMinutes

func (r *Event) EveryFiveMinutes() schedule.Event

EveryFiveMinutes schedule the event to run every five minutes.

func (*Event) EveryFiveSeconds

func (r *Event) EveryFiveSeconds() schedule.Event

EveryFiveSeconds schedule the event to run every five seconds.

func (*Event) EveryFourHours

func (r *Event) EveryFourHours() schedule.Event

EveryFourHours schedule the event to run every four hours.

func (*Event) EveryFourMinutes

func (r *Event) EveryFourMinutes() schedule.Event

EveryFourMinutes schedule the event to run every four minutes.

func (*Event) EveryMinute

func (r *Event) EveryMinute() schedule.Event

EveryMinute schedule the event to run every minute.

func (*Event) EverySecond

func (r *Event) EverySecond() schedule.Event

EverySecond schedule the event to run every second.

func (*Event) EverySixHours

func (r *Event) EverySixHours() schedule.Event

EverySixHours schedule the event to run every six hours.

func (*Event) EveryTenMinutes

func (r *Event) EveryTenMinutes() schedule.Event

EveryTenMinutes schedule the event to run every ten minutes.

func (*Event) EveryTenSeconds

func (r *Event) EveryTenSeconds() schedule.Event

EveryTenSeconds schedule the event to run every ten seconds.

func (*Event) EveryThirtyMinutes

func (r *Event) EveryThirtyMinutes() schedule.Event

EveryThirtyMinutes schedule the event to run every thirty minutes.

func (*Event) EveryThirtySeconds

func (r *Event) EveryThirtySeconds() schedule.Event

EveryThirtySeconds schedule the event to run every thirty seconds.

func (*Event) EveryThreeHours

func (r *Event) EveryThreeHours() schedule.Event

EveryThreeHours schedule the event to run every three hours.

func (*Event) EveryThreeMinutes

func (r *Event) EveryThreeMinutes() schedule.Event

EveryThreeMinutes schedule the event to run every three minutes.

func (*Event) EveryTwentySeconds

func (r *Event) EveryTwentySeconds() schedule.Event

EveryTwentySeconds schedule the event to run every twenty seconds.

func (*Event) EveryTwoHours

func (r *Event) EveryTwoHours() schedule.Event

EveryTwoHours schedule the event to run every two hours.

func (*Event) EveryTwoMinutes

func (r *Event) EveryTwoMinutes() schedule.Event

EveryTwoMinutes schedule the event to run every two minutes.

func (*Event) EveryTwoSeconds

func (r *Event) EveryTwoSeconds() schedule.Event

EveryTwoSeconds schedule the event to run every two seconds.

func (*Event) Fridays

func (r *Event) Fridays() schedule.Event

Fridays schedule the event to run on Fridays.

func (*Event) GetCallback

func (r *Event) GetCallback() func()

func (*Event) GetCommand

func (r *Event) GetCommand() string

func (*Event) GetCron

func (r *Event) GetCron() string

func (*Event) GetDelayIfStillRunning

func (r *Event) GetDelayIfStillRunning() bool

func (*Event) GetName

func (r *Event) GetName() string

func (*Event) GetSkipIfStillRunning

func (r *Event) GetSkipIfStillRunning() bool

func (*Event) Hourly

func (r *Event) Hourly() schedule.Event

Hourly schedule the event to run hourly.

func (*Event) HourlyAt

func (r *Event) HourlyAt(offset []string) schedule.Event

HourlyAt schedule the event to run hourly at a given offset in the hour.

func (*Event) IsOnOneServer

func (r *Event) IsOnOneServer() bool

func (*Event) Mondays

func (r *Event) Mondays() schedule.Event

Mondays schedule the event to run on Mondays.

func (*Event) Monthly

func (r *Event) Monthly() schedule.Event

Monthly schedule the event to run monthly.

func (*Event) Name

func (r *Event) Name(name string) schedule.Event

func (*Event) OnOneServer

func (r *Event) OnOneServer() schedule.Event

func (*Event) Quarterly

func (r *Event) Quarterly() schedule.Event

Quarterly schedule the event to run quarterly.

func (*Event) Saturdays

func (r *Event) Saturdays() schedule.Event

Saturdays schedule the event to run on Saturdays.

func (*Event) SkipIfStillRunning

func (r *Event) SkipIfStillRunning() schedule.Event

SkipIfStillRunning do not allow the event to overlap each other.

func (*Event) Sundays

func (r *Event) Sundays() schedule.Event

Sundays schedule the event to run on Sundays.

func (*Event) Thursdays

func (r *Event) Thursdays() schedule.Event

Thursdays schedule the event to run on Thursdays.

func (*Event) Tuesdays

func (r *Event) Tuesdays() schedule.Event

Tuesdays schedule the event to run on Tuesdays.

func (*Event) TwiceDaily

func (r *Event) TwiceDaily(hours ...int) schedule.Event

TwiceDaily schedule the event to run twice a day,default at 1:00 and 13:00.

func (*Event) Wednesdays

func (r *Event) Wednesdays() schedule.Event

Wednesdays schedule the event to run on Wednesdays.

func (*Event) Weekdays

func (r *Event) Weekdays() schedule.Event

Weekdays schedule the event to run on weekdays (Monday to Friday).

func (*Event) Weekends

func (r *Event) Weekends() schedule.Event

Weekends schedule the event to run on weekends (Saturday and Sunday).

func (*Event) Weekly

func (r *Event) Weekly() schedule.Event

Weekly schedule the event to run weekly.

func (*Event) Yearly

func (r *Event) Yearly() schedule.Event

Yearly schedule the event to run yearly.

type Logger

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

func NewLogger

func NewLogger(log log.Log, debug bool) *Logger

func (*Logger) Error

func (log *Logger) Error(err error, msg string, keysAndValues ...any)

func (*Logger) Info

func (log *Logger) Info(msg string, keysAndValues ...any)

type ScheduleRunner

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

func NewScheduleRunner

func NewScheduleRunner(config config.Config, schedule schedule.Schedule) *ScheduleRunner

func (*ScheduleRunner) Run

func (r *ScheduleRunner) Run() error

func (*ScheduleRunner) ShouldRun

func (r *ScheduleRunner) ShouldRun() bool

func (*ScheduleRunner) Shutdown

func (r *ScheduleRunner) Shutdown() error

func (*ScheduleRunner) Signature

func (r *ScheduleRunner) Signature() string

type ServiceProvider

type ServiceProvider struct {
}

func (*ServiceProvider) Boot

func (r *ServiceProvider) Boot(app foundation.Application)

func (*ServiceProvider) Register

func (r *ServiceProvider) Register(app foundation.Application)

func (*ServiceProvider) Relationship

func (r *ServiceProvider) Relationship() binding.Relationship

func (*ServiceProvider) Runners

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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