Documentation ¶
Index ¶
- Constants
- type Batch
- type BatchInfo
- type Factory
- func (f *Factory) AddBehavior(name string, byt []byte)
- func (f *Factory) AddTask(name string, cnt int32) error
- func (f *Factory) AppendReport(rep Report)
- func (f *Factory) Close()
- func (f *Factory) CreateDebugBot(name string, fbyt []byte) *bot.Bot
- func (f *Factory) CreateTask(name string, num int, bwg *utils.SizeWaitGroup) *Batch
- func (f *Factory) FindBehavior(name string) (database.BehaviorInfo, error)
- func (f *Factory) FindBot(botid string) *bot.Bot
- func (f *Factory) GetBatchInfo() []BatchInfo
- func (f *Factory) GetBehaviors() []database.BehaviorInfo
- func (f *Factory) GetReport() []Report
- func (f *Factory) RmvBehavior(name string)
- func (f *Factory) RmvBot(botid string)
- type Option
- type Parm
- type Report
- type TaskInfo
Constants ¶
View Source
const ( FactoryModeStatic = "static" FactoryModeIncrease = "increase" )
机器人的运行模式
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct { ID string Name string CurNum int32 TotalNum int32 Errors int32 // contains filtered or unexported fields }
func CreateBatch ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
var Global *Factory
func (*Factory) AddBehavior ¶
func (*Factory) AppendReport ¶
func (*Factory) CreateDebugBot ¶
func (*Factory) CreateTask ¶
func (*Factory) FindBehavior ¶
func (f *Factory) FindBehavior(name string) (database.BehaviorInfo, error)
func (*Factory) GetBatchInfo ¶
func (*Factory) GetBehaviors ¶
func (f *Factory) GetBehaviors() []database.BehaviorInfo
func (*Factory) RmvBehavior ¶
type Option ¶
type Option func(*Parm)
Option consul discover config wrapper
func WithReportLimit ¶
func WithScriptPath ¶
type Parm ¶
type Parm struct { // Interrupt 当card遇到err的时候是否中断整个程序 (默认为否 Interrupt bool ScriptPath string ReportLimit int // contains filtered or unexported fields }
Parm 机器人工厂可配置参数
Click to show internal directories.
Click to hide internal directories.