schedules

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ctx

type Ctx struct {
	Request  Request
	Response *Response
	Extras   map[string]interface{}
	// contains filtered or unexported fields
}

func NewCtx

func NewCtx(msg *schedulespb.ServerMessage) *Ctx

func (*Ctx) ToClientMessage

func (c *Ctx) ToClientMessage() *schedulespb.ClientMessage

func (*Ctx) WithError

func (c *Ctx) WithError(err error)

type Request

type Request interface {
	ScheduleName() string
}

type Response

type Response struct {
	Success bool
}

type Schedule

type Schedule interface {
	// Run a function at a certain interval defined by the cronExpression.
	// Valid function signatures for handler are:
	//
	//	func()
	//	func() error
	//	func(*schedules.Ctx)
	//	func(*schedules.Ctx) error
	//	Handler[schedules.Ctx]
	Cron(cron string, handler interface{})

	// Run a function at a certain interval defined by the rate. The rate is e.g. '7 days'. All rates accept a number and a frequency. Valid frequencies are 'days', 'hours' or 'minutes'.
	// Valid function signatures for handler are:
	//
	//	func()
	//	func() error
	//	func(*schedules.Ctx)
	//	func(*schedules.Ctx) error
	//	Handler[schedules.Ctx]
	Every(rate string, handler interface{})
}

func NewSchedule

func NewSchedule(name string) Schedule

NewSchedule - Create a new Schedule resource

Jump to

Keyboard shortcuts

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