Documentation
¶
Index ¶
- type Base
- 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() *resty.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}"`
// 卡片
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 {
// Setup 设置配置信息
Setup() (err error)
// Fields 导出所有字段
Fields() gox.Fields[any]
// contains filtered or unexported methods
}
Config 配置
type Constructor ¶
type Constructor func() Plugin
Source Files
¶
Click to show internal directories.
Click to hide internal directories.