Documentation
¶
Index ¶
- type Base
- func (b *Base) After() (err error)
- func (b *Base) Before() (err error)
- func (b *Base) Carding() (card any, err error)
- func (b *Base) Cleanup() *cleanup.Builder
- func (b *Base) Command(command string) (builder *command.Builder)
- func (b *Base) Default() bool
- func (b *Base) Elapsed() time.Duration
- func (b *Base) Expressions() (expressions core.Expressions)
- func (b *Base) Fields() gox.Fields[any]
- func (b *Base) Home(paths ...string) (final string)
- func (b *Base) Http() *http.Client
- func (b *Base) Parse(to map[string]string, configs ...string)
- func (b *Base) Parses(to map[string][]string, configs ...string)
- func (b *Base) Request() *resty.Request
- func (b *Base) Scheme() (scheme string)
- func (b *Base) Setup() (err error)
- func (b *Base) Since() time.Duration
- func (b *Base) Value(key string) *internal.Value
- type Bootstrap
- type Config
- type Constructor
- type Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { log.Logger // 是否启用默认配置 Defaults *bool `default:"${DEFAULT=true}"` // 是否显示详细信息 Verbose bool `default:"${VERBOSE=false}"` // 日志配置 Level string `default:"${LEVEL=info}"` // 是否在出错时打印输出 Pwe *bool `default:"${PWE=true}"` // 是否重试 Retry *bool `default:"${RETRY=true}"` // 重试次数 Counts int `default:"${COUNTS=5}"` // 重试间隔 Backoff time.Duration `default:"${BACKOFF=5s}"` // 超时时间 Timeout time.Duration `default:"${TIMEOUT=60m}"` // 代理 Proxy *config.Proxy `default:"${PROXY}"` // 多个代理 Proxies []*config.Proxy `default:"${PROXIES}"` // 卡片 Card config.Card `default:"${CARD}"` // 命令列表 Commands []string `default:"${COMMANDS}"` // contains filtered or unexported fields }
Base 插件基础
func (*Base) Expressions ¶
func (b *Base) Expressions() (expressions core.Expressions)
type Bootstrap ¶
type Bootstrap struct { *Base // contains filtered or unexported fields }
func New ¶
func New(constructor Constructor) (bootstrap *Bootstrap)
type Config ¶
type Config interface { // Fields 导出所有字段 Fields() gox.Fields[any] // contains filtered or unexported methods }
Config 配置
type Constructor ¶
type Constructor func() Plugin
type Plugin ¶
type Plugin interface { // Scheme 卡片模板 Scheme() (scheme string) // Carding 卡片数据 Carding() (card any, err error) // Config 加载配置 Config() (config Config) // Setup 设置配置信息 Setup() (err error) // Before 插件运行前执行 Before() (err error) // Steps 插件运行步骤 Steps() step.Steps // After 插件运行后执行 After() (err error) // Expressions 表达式 Expressions() core.Expressions }
Plugin 插件接口,任何插件都需要实现这个接口
Source Files
¶
Click to show internal directories.
Click to hide internal directories.