tick

package
v0.0.0-...-90797dc Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CronExpHeartbeat    = "*/16 * * * * ?"
	CronExpSyncSchedule = "*/18 * * * * ?"
	CronExpWatchDied    = "*/32 * * * * ?"
)

Variables

This section is empty.

Functions

func RegisterListener

func RegisterListener(ltn Listener)

func RegisterSchedule

func RegisterSchedule(req *ScheduleIO) (schedule.ID, *errors.Error)

Types

type Daemon

type Daemon struct {
}

func NewDaemon

func NewDaemon(db *gorm.DB) *Daemon

func (*Daemon) Code

func (d *Daemon) Code() string

func (*Daemon) Shutdown

func (d *Daemon) Shutdown(_ context.Context) *errors.Error

func (*Daemon) Startup

func (d *Daemon) Startup() *errors.Error

type Listener

type Listener interface {
	GetName() string
	Match(job *def.Job) bool
	Deal(job *def.Job) (any, error)
}

type Schedule

type Schedule struct {
	ID      schedule.ID
	Token   token.Token
	Cron    schedule.Cron
	Options *schedule.Options
	Job     *def.Job
	Version uint64
	// contains filtered or unexported fields
}

type ScheduleIO

type ScheduleIO struct {
	Title     string        `json:"title"`
	Code      string        `json:"code"`
	OutID     string        `json:"out_id"`
	Cron      schedule.Cron `json:"cron"`
	Topic     string        `json:"topic"`
	Payload   *def.Payload  `json:"payload"`
	Signature string        `json:"signature"`
}

func (*ScheduleIO) Verify

func (req *ScheduleIO) Verify() *errors.Error

type Tick

type Tick struct {
	ID     tick.ID
	Tokens []token.Token
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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