drone

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 10 Imported by: 20

README

drone

Drone插件基础框架

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(constructor constructor, opts ...option) (err error)

Bootstrap 启动插件

func Configs

func Configs(configs ...string) *optionConfigs

Configs 配置组

func Name

func Name(name string) *optionName

Name 配置插件名称

func NewOptions

func NewOptions(options ...option) []option

NewOptions 创建选项

Types

type Config

type Config struct {
	// 是否启用默认配置
	Defaults bool `default:"${PLUGIN_DEFAULTS=${DEFAULTS=true}}"`
	// 是否显示详细信息
	Verbose bool `default:"${PLUGIN_VERBOSE=${VERBOSE=false}}"`
	// 是否显示调试信息
	Debug bool `default:"${PLUGIN_DEBUG=${DEBUG=false}}"`

	// 是否重试
	Retry bool `default:"${PLUGIN_RETRY=${RETRY=true}}"`
	// 重试次数
	Counts int `default:"${PLUGIN_COUNTS=${COUNTS=5}}"`
	// 重试间隔
	Backoff time.Duration `default:"${PLUGIN_BACKOFF=${BACKOFF=5s}}"`
}

Config 插件基础配置

func (*Config) Basic added in v0.0.2

func (c *Config) Basic() *Config

func (*Config) Fields added in v0.0.2

func (c *Config) Fields() gox.Fields

type Configuration added in v0.0.2

type Configuration interface {
	// Fields 导出所有字段
	Fields() gox.Fields

	// Basic 基础配置
	Basic() *Config
}

Configuration 配置

type Plugin added in v0.0.2

type Plugin interface {
	// Configuration 加载配置
	Configuration() (configuration Configuration)

	// Steps 插件运行步骤
	Steps() []*Step
}

Plugin 插件

type Step added in v0.0.2

type Step struct {
	// contains filtered or unexported fields
}

Step 步骤

func NewStep added in v0.0.2

func NewStep(do do, opts ...stepOption) *Step

NewStep 创建一个步骤

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL