Add Context struct

This commit is contained in:
Don 2019-09-09 17:34:39 -07:00
parent a3ef97d454
commit c7b7745e10

View File

@ -8,23 +8,27 @@ package plugin
import "time" import "time"
type ( type (
// BaseConfig is the common configuration for a plugin. // Context contains information about the current execution context.
// //
// The configuration organizes all the information available to a plugin // The context organizes all the information available to a plugin executing
// executing as a step within a stage. // as a step within a stage.
// //
// Plugins can choose to compose this within their own config. // Plugins can choose to compose this within their own config.
// //
// import "github.com/drone-plugins/drone-plugin-lib/pkg/plugin" // import "github.com/drone-plugins/drone-plugin-lib/pkg/plugin"
// //
// type MyPluginConfig struct { // type MyPluginContext struct {
// plugin.BaseConfig // plugin.Context
// Foo string // Foo string
// Bar string // Bar string
// } // }
BaseConfig struct { Context struct {
Stage Stage Build Build
Step Step Repo Repo
Commit Commit
Stage Stage
Step Step
SemVer SemVer
} }
// Build represents a build of a repository. // Build represents a build of a repository.