Documentation
¶
Index ¶
- func Aliases(aliases ...*alias) *optionAliases
- func Args(args ...interface{}) *optionArgs
- func Async() *optionAsync
- func Bootstrap(constructor constructor, opts ...option) (err error)
- func Break() *optionBreak
- func Contains(contains string) *optionContains
- func Continue() *optionBreak
- func Dir(dir string) *optionDir
- func DisablePwe() *optionPwe
- func Env(key string, value string) *optionEnvironment
- func Environment(key string, value string) *optionEnvironment
- func Equal(equal string) *optionEqual
- func Fields(fields ...gox.Field[any]) *optionFields
- func Interrupt() *optionRetry
- func Name(name string) *optionName
- func NewAlias(name string, value string) *alias
- func NewExecOptions(options ...execOption) []execOption
- func NewOptions(options ...option) []option
- func NewStepOptions(opts ...stepOption) []stepOption
- func Pwe() *optionPwe
- func Retry() *optionRetry
- func String(output *string) *optionString
- func StringEnv(env string) *optionStringEnvironments
- func StringEnvironment(environment string) *optionStringEnvironments
- func StringEnvironments(environments ...string) *optionStringEnvironments
- func StringEnvs(envs ...string) *optionStringEnvironments
- func Sync() *optionAsync
- type Base
- func (b *Base) BaseConfig() *Base
- func (b *Base) Card() (card any, err error)
- func (b *Base) Exec(command string, opts ...execOption) error
- func (b *Base) Fields() gox.Fields[any]
- func (b *Base) Interval() time.Duration
- func (b *Base) Parse(to map[string]string, configs ...string)
- func (b *Base) Parses(to map[string][]string, configs ...string)
- func (b *Base) Scheme() (scheme string)
- func (b *Base) Setup() (unset bool, err error)
- type Config
- type Plugin
- type Step
- type Steps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Environment ¶ added in v0.3.3
Environment 环境变量
func NewExecOptions ¶ added in v0.3.9
func NewExecOptions(options ...execOption) []execOption
NewExecOptions 创建运行选项
func NewStepOptions ¶ added in v0.5.4
func NewStepOptions(opts ...stepOption) []stepOption
NewStepOptions 创建步骤选项
func StringEnv ¶ added in v0.3.2
func StringEnv(env string) *optionStringEnvironments
StringEnv 环境变量
func StringEnvironment ¶ added in v0.3.3
func StringEnvironment(environment string) *optionStringEnvironments
StringEnvironment 环境变量
func StringEnvironments ¶ added in v0.3.3
func StringEnvironments(environments ...string) *optionStringEnvironments
StringEnvironments 环境变量列表
func StringEnvs ¶ added in v0.3.2
func StringEnvs(envs ...string) *optionStringEnvironments
StringEnvs 环境变量列表
Types ¶
type Base ¶ added in v0.1.0
type Base struct {
simaqian.Logger
// 是否启用默认配置
Defaults bool `default:"${PLUGIN_DEFAULTS=${DEFAULTS=true}}"`
// 是否显示详细信息
Verbose bool `default:"${PLUGIN_VERBOSE=${VERBOSE=false}}"`
// 是否显示调试信息
Level string `default:"${PLUGIN_LEVEL=${LEVEL=debug}}"`
// 是否在出错时打印输出
Pwe bool `default:"${PLUGIN_PWE=${PWE=true}}"`
// 是否重试
Retry bool `default:"${PLUGIN_RETRY=${RETRY=true}}"`
// 重试次数
Counts int `default:"${PLUGIN_COUNTS=${COUNTS=5}}"`
// 重试间隔
Backoff time.Duration `default:"${PLUGIN_BACKOFF=${BACKOFF=5s}}"`
// 卡片路径
CardPath string `default:"${DRONE_CARD_PATH=/dev/stdout}"`
}
Base 插件基础
func (*Base) BaseConfig ¶ added in v0.3.7
type Config ¶
type Config interface {
// Setup 设置配置信息
Setup() (unset bool, err error)
// Fields 导出所有字段
Fields() gox.Fields[any]
// BaseConfig 基础配置
BaseConfig() *Base
}
Config 配置
type Plugin ¶ added in v0.0.2
type Plugin interface {
// Scheme 卡片模板
Scheme() (scheme string)
// Card 卡片数据
Card() (card any, err error)
// Interval 卡片数据写入间隔
Interval() time.Duration
// Config 加载配置
Config() (config Config)
// Steps 插件运行步骤
Steps() Steps
}
Plugin 插件接口,任何插件都需要实现这个接口
type Step ¶ added in v0.0.2
type Step struct {
gox.CannotCopy
// contains filtered or unexported fields
}
Step 步骤
func NewDelayStep ¶ added in v0.2.5
NewDelayStep 创建延迟步骤,调试使用
Source Files
¶
- alias.go
- base.go
- base_card.go
- base_parse.go
- bootstrap.go
- card.go
- checker.go
- checker_mode.go
- collector.go
- collector_mode.go
- config.go
- const.go
- constructor.go
- do.go
- env.go
- exec.go
- exec_option.go
- option.go
- option_aliases.go
- option_args.go
- option_async.go
- option_break.go
- option_contains.go
- option_dir.go
- option_environment.go
- option_environments_string.go
- option_equal.go
- option_fields.go
- option_name.go
- option_pwe.go
- option_retry.go
- option_string.go
- plugin.go
- slice_processor.go
- step.go
- step_option.go
- steps.go
Click to show internal directories.
Click to hide internal directories.

