drone

package module
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 28 Imported by: 20

README

drone

编译状态 Golang质量 版本 仓库大小 最后提交 授权协议 语言个数 最佳语言 星星个数

Drone插件基础框架,提供如下功能

  • 基础配置
    • 重试
    • 背压
    • 配置解析
    • 命名
  • 接口抽象
    • 步骤
    • 配置
    • 插件

使用

非常简单,只需要在.drone.yml里增加配置

- name: 上传到腾讯云
  image: ccr.ccs.tencentyun.com/dronestock/cos
  settings:
    secret_id: xxx
    secret_key: xxx

更多使用教程,请参考文档

交流

微信群

捐助

支持宝 微信

插件列表

  • Git 使用Git推送和拉取代码
  • Maven Maven编译、打包、测试以及发布到仓库
  • Protobuf Protobuf编译、静态检查以及高级功能
  • Docker Docker编译、打包以及发布到镜像仓库
  • Node Node编译、打包以及发布到仓库
  • Cos 腾讯云对象存储基本配置、文件上传等
  • Mcu 各种模块依赖文件修改
  • Apisix Apisix网关插件
  • File 文件插件

感谢Jetbrains

本项目通过Jetbrains开源许可IDE编写源代码,特此感谢

Jetbrains图标

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.6.4

func New(constructor constructor) (boot *bootstrap)

func NewStep added in v0.0.2

func NewStep(stepper stepper) *stepBuilder

NewStep 创建一个步骤

Types

type Base added in v0.1.0

type Base struct {
	simaqian.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}"`

	// 代理
	Proxy *proxy `default:"${PROXY}"`
	// 卡片
	Card card `default:"${CARD}"`
	// 命令列表
	Commands []string `default:"${COMMANDS}"`
	// contains filtered or unexported fields
}

Base 插件基础

func (*Base) Carding added in v0.6.4

func (b *Base) Carding() (card any, err error)

func (*Base) Cleanup added in v0.8.3

func (b *Base) Cleanup() *cleanupBuilder

func (*Base) Command added in v0.6.4

func (b *Base) Command(command string) (builder *commandBuilder)

func (*Base) Default added in v0.7.9

func (b *Base) Default() bool

func (*Base) Expressions added in v0.9.3

func (b *Base) Expressions() (expressions Expressions)

func (*Base) Fields added in v0.1.0

func (b *Base) Fields() gox.Fields[any]

func (*Base) Http added in v0.6.1

func (b *Base) Http() *resty.Request

func (*Base) Parse added in v0.1.0

func (b *Base) Parse(to map[string]string, configs ...string)

func (*Base) Parses added in v0.1.0

func (b *Base) Parses(to map[string][]string, configs ...string)

func (*Base) Scheme added in v0.4.8

func (b *Base) Scheme() (scheme string)

func (*Base) Setup added in v0.1.0

func (b *Base) Setup() (err error)

type Config

type Config interface {
	// Setup 设置配置信息
	Setup() (err error)

	// Fields 导出所有字段
	Fields() gox.Fields[any]
	// contains filtered or unexported methods
}

Config 配置

type Expressions added in v0.9.3

type Expressions []expression

Expressions 表达式集合

type Plugin added in v0.0.2

type Plugin interface {
	// Scheme 卡片模板
	Scheme() (scheme string)

	// Carding 卡片数据
	Carding() (card any, err error)

	// Config 加载配置
	Config() (config Config)

	// Steps 插件运行步骤
	Steps() Steps

	// Expressions 表达式
	Expressions() Expressions
}

Plugin 插件接口,任何插件都需要实现这个接口

type Step added in v0.0.2

type Step struct {
	gox.CannotCopy
	// contains filtered or unexported fields
}

Step 步骤

func NewDebugStep added in v0.5.1

func NewDebugStep() *Step

NewDebugStep 创建延迟步骤,调试使用

func NewDelayStep added in v0.2.5

func NewDelayStep(delay time.Duration) *Step

NewDelayStep 创建延迟步骤,调试使用

type Steps added in v0.5.4

type Steps []*Step

Steps 步骤集

func (*Steps) Add added in v0.5.6

func (s *Steps) Add(steps ...*Step)

Jump to

Keyboard shortcuts

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