cron

package
v0.445.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context, config Config, eventSource schemaeventsource.EventSource, client routing.CallClient, timelineClient *timelineclient.Client) error

Start the cron service. Blocks until the context is cancelled.

Types

type Config

type Config struct {
	Bind                  *url.URL        `help:"Address to bind to." env:"FTL_BIND" default:"http://127.0.0.1:8990"`
	SchemaServiceEndpoint *url.URL        `name:"ftl-endpoint" help:"Schema Service endpoint." env:"FTL_SCHEMA_ENDPOINT" default:"http://127.0.0.1:8897"`
	TimelineEndpoint      *url.URL        `help:"Timeline endpoint." env:"FTL_TIMELINE_ENDPOINT" default:"http://127.0.0.1:8894"`
	Raft                  raft.RaftConfig `embed:"" prefix:"raft-"`
}

type CronEvent added in v0.445.0

type CronEvent struct {
	// Job that was executed
	JobKey string
	// When the job was executed
	ExecutedAt time.Time
	// Next scheduled execution
	NextExecution time.Time
}

CronEvent represents changes to the cron state

func (CronEvent) Handle added in v0.445.0

func (e CronEvent) Handle(state CronState) (CronState, error)

Handle applies the event to the view

func (CronEvent) MarshalBinary added in v0.445.0

func (e CronEvent) MarshalBinary() ([]byte, error)

func (*CronEvent) UnmarshalBinary added in v0.445.0

func (e *CronEvent) UnmarshalBinary(data []byte) error

type CronState added in v0.445.0

type CronState struct {
	// Map of job key to last execution time
	LastExecutions map[string]time.Time `protobuf:"1"`
	// Map of job key to next scheduled time
	NextExecutions map[string]time.Time `protobuf:"2"`
}

CronState is the state of scheduled cron jobs

func CronStateFromProto added in v0.445.0

func CronStateFromProto(v *destpb.CronState) (out *CronState, err error)

func (*CronState) Marshal added in v0.445.0

func (v *CronState) Marshal() ([]byte, error)

func (*CronState) ToProto added in v0.445.0

func (x *CronState) ToProto() *destpb.CronState

func (*CronState) Unmarshal added in v0.445.0

func (v *CronState) Unmarshal(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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