Documentation
¶
Index ¶
- Constants
- func ConsumeWorkerOption(worker int) func(r *Railgun)
- func NewMessage(ctx context.Context, traceName string, data []byte) (m *message)
- type Config
- type CronDoFunc
- type CronInputer
- type CronInputerConfig
- type CronProcessor
- type CronProcessorConfig
- type CronUniqConfig
- type Inputer
- type ManualInputer
- type ManualInputerConfig
- type Message
- type MsgPolicy
- type PrivateMessage
- type Railgun
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func ConsumeWorkerOption ¶
Types ¶
type CronInputer ¶
type CronInputer struct {
*ManualInputer
// contains filtered or unexported fields
}
func NewCronInputer ¶
func NewCronInputer(cfg *CronInputerConfig) *CronInputer
type CronInputerConfig ¶
type CronInputerConfig struct {
/*
doc: https://github.com/robfig/cron/blob/v1/doc.go
Field name | Mandatory? | Allowed values | Allowed special characters
---------- | ---------- | -------------- | --------------------------
Seconds | Yes | 0-59 | * / , -
Minutes | Yes | 0-59 | * / , -
Hours | Yes | 0-23 | * / , -
Day of month | Yes | 1-31 | * / , - ?
Month | Yes | 1-12 or JAN-DEC | * / , -
Day of week | Yes | 0-6 or SUN-SAT | * / , - ?
Entry | Description | Equivalent To
----- | ----------- | -------------
@yearly (or @annually) | Run once a year, midnight, Jan. 1st | 0 0 0 1 1 *
@monthly | Run once a month, midnight, first of month | 0 0 0 1 * *
@weekly | Run once a week, midnight between Sat/Sun | 0 0 0 * * 0
@daily (or @midnight) | Run once a day, midnight | 0 0 0 * * *
@hourly | Run once an hour, beginning of hour | 0 0 * * * *
example:
@every 5m
@every 1h30m
*/
Spec string
}
type CronProcessor ¶
type CronProcessor struct {
// contains filtered or unexported fields
}
func NewCronProcessor ¶
func NewCronProcessor(config *CronProcessorConfig, do CronDoFunc, opts ...func(*CronProcessor)) (res *CronProcessor)
流程: 定时任务触发处理流程
type CronProcessorConfig ¶
type CronUniqConfig ¶
type CronUniqConfig struct {
}
type ManualInputer ¶
type ManualInputer struct {
// contains filtered or unexported fields
}
func NewManualInputer ¶
func NewManualInputer(cfg *ManualInputerConfig) *ManualInputer
func (*ManualInputer) Add ¶
func (d *ManualInputer) Add(ctx context.Context, data []byte) (err error)
func (*ManualInputer) AwesomeRailgun ¶
func (*ManualInputer) AwesomeRailgun()
type ManualInputerConfig ¶
type ManualInputerConfig struct {
Buffer int
}
type PrivateMessage ¶
Click to show internal directories.
Click to hide internal directories.