mirror of
https://github.com/drone-plugins/drone-webhook.git
synced 2026-06-04 18:24:05 +08:00
69b094965b
This commit is doing a general refactoring of the current code base and it also integrates the new plugin lib.
28 lines
462 B
Go
28 lines
462 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// webhook defines the result payload.
|
|
type webhook struct {
|
|
Number int
|
|
URL string
|
|
Method string
|
|
Header http.Header
|
|
Status string
|
|
Request string
|
|
Response string
|
|
Debug bool
|
|
}
|
|
|
|
// result defines the output template.
|
|
const result = `Webhook {{Number}}
|
|
URL: {{URL}}{{#if Debug}}
|
|
METHOD: {{Method}}
|
|
HEADERS: {{Headers}}
|
|
REQUEST: {{Request}}{{/if}}
|
|
STATUS: {{Status}}
|
|
RESPONSE: {{Response}}
|
|
`
|