github.com/goravel/framework@v1.13.9/contracts/schedule/event.go (about)

     1  package schedule
     2  
     3  //go:generate mockery --name=Event
     4  type Event interface {
     5  	// At schedule the event to run at the specified time.
     6  	At(time string) Event
     7  	// Cron schedule the event using the given Cron expression.
     8  	Cron(expression string) Event
     9  	// Daily schedule the event to run daily.
    10  	Daily() Event
    11  	// DailyAt schedule the event to run daily at a given time (10:00, 19:30, etc).
    12  	DailyAt(time string) Event
    13  	// DelayIfStillRunning if the event is still running, the event will be delayed.
    14  	DelayIfStillRunning() Event
    15  	// EveryMinute schedule the event to run every minute.
    16  	EveryMinute() Event
    17  	// EveryTwoMinutes schedule the event to run every two minutes.
    18  	EveryTwoMinutes() Event
    19  	// EveryThreeMinutes schedule the event to run every three minutes.
    20  	EveryThreeMinutes() Event
    21  	// EveryFourMinutes schedule the event to run every four minutes.
    22  	EveryFourMinutes() Event
    23  	// EveryFiveMinutes schedule the event to run every five minutes.
    24  	EveryFiveMinutes() Event
    25  	// EveryTenMinutes schedule the event to run every ten minutes.
    26  	EveryTenMinutes() Event
    27  	// EveryFifteenMinutes schedule the event to run every fifteen minutes.
    28  	EveryFifteenMinutes() Event
    29  	// EveryThirtyMinutes schedule the event to run every thirty minutes.
    30  	EveryThirtyMinutes() Event
    31  	// EveryTwoHours schedule the event to run every two hours.
    32  	EveryTwoHours() Event
    33  	// EveryThreeHours schedule the event to run every three hours.
    34  	EveryThreeHours() Event
    35  	// EveryFourHours schedule the event to run every four hours.
    36  	EveryFourHours() Event
    37  	// EverySixHours schedule the event to run every six hours.
    38  	EverySixHours() Event
    39  	// GetCron get cron expression.
    40  	GetCron() string
    41  	// GetCommand get the command.
    42  	GetCommand() string
    43  	// GetCallback get callback.
    44  	GetCallback() func()
    45  	// GetName get name.
    46  	GetName() string
    47  	// GetSkipIfStillRunning get skipIfStillRunning bool.
    48  	GetSkipIfStillRunning() bool
    49  	// GetDelayIfStillRunning get delayIfStillRunning bool.
    50  	GetDelayIfStillRunning() bool
    51  	// Hourly schedule the event to run hourly.
    52  	Hourly() Event
    53  	// HourlyAt schedule the event to run hourly at a given offset in the hour.
    54  	HourlyAt(offset []string) Event
    55  	// IsOnOneServer get isOnOneServer bool.
    56  	IsOnOneServer() bool
    57  	// Name set the event name.
    58  	Name(name string) Event
    59  	// OnOneServer only allow the event to run on one server for each cron expression.
    60  	OnOneServer() Event
    61  	// SkipIfStillRunning if the event is still running, the event will be skipped.
    62  	SkipIfStillRunning() Event
    63  }