Documentation
¶
Index ¶
Constants ¶
const ( FlagsRepositoryCategory = "Woodpecker Repository Flags" FlagsPipelineCategory = "Woodpecker Pipeline Flags" FlagsCommitCategory = "Woodpecker Commit Flags" FlagsStepCategory = "Woodpecker Step Flags" FlagsSystemCategory = "Woodpecker System Flags" FlagsPluginCategory = "Plugin Flags" )
Variables ¶
var ErrTypeAssertionFailed = errors.New("type assertion failed")
Functions ¶
Types ¶
type Commit ¶
type Commit struct {
URL string
SHA string
Ref string
Refspec string
PullRequest int64
SourceBranch string
TargetBranch string
Branch string
Tag string
Message string
Title string
Description string
Author Author
}
Commit defines runtime metadata for a commit.
type Environment ¶
func EnvironmentFromContext ¶
func EnvironmentFromContext(cmd *cli.Command) (Environment, error)
func (Environment) Lookup ¶
func (e Environment) Lookup(key string) (string, bool)
Lookup retrieves the value for the given key from the Environment. If the key is not found in the Environment, it falls back to looking up the value in the OS environment.
func (Environment) Value ¶
func (e Environment) Value() []string
Value returns a slice of strings representing the key-value pairs of the Environment. Each string is formatted as "key=value".
type ExecuteFunc ¶
ExecuteFunc defines the function that is executed by the plugin.
type Metadata ¶
type Metadata struct {
Repository Repository
Pipeline Pipeline
Curr Commit
Prev Commit
Step Step
System System
}
Metadata defines runtime metadata.
func MetadataFromContext ¶
MetadataFromContext creates a Metadata from the cli.Command.
type Network ¶
type Network struct {
// Context for making network requests.
//
// If `trace` logging is requested the context will use `httptrace` to
// capture all network requests.
//nolint:containedctx
Context context.Context
/// Whether SSL verification is skipped or not.
InsecureSkipVerify bool
// Client for making network requests.
Client *http.Client
}
Network contains options for connecting to the network.
func NetworkFromContext ¶
type Options ¶
type Options struct {
// Name of the plugin.
Name string
// Description of the plugin.
Description string
// Version of the plugin.
Version string
// Version metadata of the plugin.
VersionMetadata string
// Flags of the plugin.
Flags []cli.Flag
// Execute function of the plugin.
Execute ExecuteFunc
// Hide woodpecker system flags.
HideWoodpeckerFlags bool
}
Options defines the options for the plugin.
type Pipeline ¶
type Pipeline struct {
Number int64
Status string
Event string
URL string
DeployTarget string
Created time.Time
Started time.Time
Finished time.Time
Parent int64
}
Pipeline defines runtime metadata for a pipeline.
type Plugin ¶
type Plugin struct {
App *cli.Command
// Network options.
Network Network
// Metadata of the current pipeline.
Metadata Metadata
Environment Environment
// contains filtered or unexported fields
}
Plugin defines the plugin instance.
type Repository ¶
type Repository struct {
Slug string
Name string
Owner string
URL string
CloneURL string
Private bool
Branch string
RemoteID int64
}
Repository defines runtime metadata for a repository.