notify_go

package module
v0.0.0-...-0e73c6a Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelFunc

type ChannelFunc func(ctx context.Context, no *Notification) error

type CircleTask

type CircleTask struct {
	IterCronTimes iterator.Iterable[time.Time]
	CronExpr      string
	BeginTime     time.Time
	EndTime       time.Time
	HookBefore    func()
	HookAfter     func()

	*Notification
	// contains filtered or unexported fields
}

CircleTask 循环触发任务

func NewCircleTask

func NewCircleTask(notification *Notification, expr string, begin time.Time, end time.Time) *CircleTask

func (*CircleTask) Send

func (ct *CircleTask) Send(ctx context.Context)

type DefaultTask

type DefaultTask struct {
	Err        chan error
	HookBefore func()
	HookAfter  func()
	*Notification
}

DefaultTask 默认任务

type Middleware

type Middleware func(channelFunc ChannelFunc) ChannelFunc

type Notification

type Notification struct {
	notifier.Delivery
	Channel notifier.IChannel
}

func NewNotification

func NewNotification(c notifier.IChannel, recvs []notifier.Receiver, content notifier.Content) *Notification

func (*Notification) Send

func (no *Notification) Send(ctx context.Context, mls ...Middleware) error

type TriggerTask

type TriggerTask struct {
	Err         chan error
	TriggerTime time.Time
	HookBefore  func()
	HookAfter   func()
	*Notification
}

TriggerTask 定时触发任务

func NewTriggerTask

func NewTriggerTask(notification *Notification, t time.Time) *TriggerTask

func (*TriggerTask) Send

func (tt *TriggerTask) Send(ctx context.Context)

Send 一次性任务

Directories

Path Synopsis
sms
example
base command
pkg
log
notifier/mocks
Code generated by MockGen.
Code generated by MockGen.
ral
store

Jump to

Keyboard shortcuts

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