package
Version:
v1.1.0
Opens a new window with list of versions in this module.
Published: Apr 24, 2024
License: AGPL-3.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Option interface {
}
Option 定义了一个接口,表示一个配置选项
func WithStart(start func()) Option
WithStart 设置工作器的启动函数选项
func WithStop(stop func()) Option
WithStop 设置工作器的停止函数选项
OptionFunc 是一种为函数类型定义的新类型,它的参数需要传递指针
type Worker struct {
Options *Options `json:"options"`
}
Worker 包含了工作器的配置选项
NewWorker 创建一个新的 Worker 实例,接受一个或多个选项
Source Files
¶
Click to show internal directories.
Click to hide internal directories.