Documentation
¶
Overview ¶
Package urfave provides helpers for interacting with the `urfave/cli` package when creating plugins for use by the Drone CI/CD service.
Drone communicates to plugins by passing in environment variables that have information on the currently executing build. The `urfave/cli` package can read these environment variables and extract them into structs.
import(
"github.com/drone-plugins/drone-plugin-lib/pkg/urfave"
"github.com/urfave/cli"
)
func main() {
app := cli.New()
app.Name = "my awesome Drone plugin"
app.Run = run
app.Flags = []cli.Flags{
// All my plugin flags
}
app.Flags = append(
app.Flags,
urfave.Flags()...,
)
}
func run(ctx *cli.Context) {
pipeline := urfave.PipelineFromContext(ctx)
....
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoggingFromContext ¶
LoggingFromContext sets the logrus logging level.
Types ¶
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.
Context context.Context
// Client for making network requests.
Client *http.Client
/// Whether SSL verification is skipped
SkipVerify bool
}
Network contains options for connecting to the network.
func NetworkFromContext ¶
NetworkFromContext creates a Transport from the cli.Context.
Click to show internal directories.
Click to hide internal directories.