crons

package
v0.0.0-...-8c3c7c7 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Second = "Second"
	Minute = "Minute"
)

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(logger *zap.Logger) cron.Logger

NewLogger 新建日志记录器

Types

type CronManage

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

func NewCronManage

func NewCronManage(mode string, logger *zap.Logger) (*CronManage, error)

func (*CronManage) Entries

func (m *CronManage) Entries() []cron.Entry

func (*CronManage) Register

func (m *CronManage) Register(job ...Job) (int, error)

func (*CronManage) RegisterFunc

func (m *CronManage) RegisterFunc(frequency string, cmd func()) (int, error)

func (*CronManage) RemoveEntity

func (m *CronManage) RemoveEntity(entityId cron.EntryID)

func (*CronManage) Start

func (m *CronManage) Start()

func (*CronManage) Stop

func (m *CronManage) Stop()

type Job

type Job interface {
	cron.Job
	Frequency() string
	SetEntityId(entityId cron.EntryID)
}

type Logger

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

func (*Logger) Error

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

func (*Logger) Info

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

func (*Logger) WithField

func (l *Logger) WithField(key string, val any) *Logger

Jump to

Keyboard shortcuts

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