Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultRemote = "origin" DefaultBranch = "main" )
Variables ¶
This section is empty.
Functions ¶
func ValidateRequest ¶
ValidateRequest validates webhook request, the webhook request should be POST.
Types ¶
type Cmd ¶
func (*Cmd) AddCommand ¶
type Repo ¶
type Repo struct {
URL string
Path string
Branch string
Depth int
Secret string
Submodule git.SubmoduleRescursivity
Auth transport.AuthMethod
// contains filtered or unexported fields
}
Repo tells information about the git repository.
type WebHook ¶
type WebHook struct {
// Git repository URL, supported http, https and ssh.
Repository string `json:"repo,omitempty"`
// Path to clone and update repository.
Path string `json:"path,omitempty"`
// Branch to pull.
// Default to `main`.
Branch string `json:"branch,omitempty"`
// Webhook type.
// Default to `github`.
Type string `json:"type,omitempty"`
// Secret to verify webhook request.
Secret string `json:"secret,omitempty"`
// Depth for pull and fetch.
// Default to `0`.
Depth string `json:"depth,omitempty"`
// Enable recurse submodules.
Submodule bool `json:"submodule,omitempty"`
// Command to run when repo initializes or receive a
// correct webhook request.
Command []string `json:"command,omitempty"`
// Path of private key, using to access git with ssh.
Key string `json:"key,omitempty"`
// Disable strict host key checking.
StrictHostKeyCheckingDisabled bool `json:"insecure,omitempty"`
// Password of private key.
KeyPassword string `json:"key_password,omitempty"`
// Username for http auth.
Username string `json:"username,omitempty"`
// Password for http auth.
Password string `json:"password,omitempty"`
// GitHub personal access token.
Token string `json:"token,omitempty"`
// contains filtered or unexported fields
}
WebHook is the module configuration.
func (*WebHook) CaddyModule ¶
func (*WebHook) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*WebHook) UnmarshlCaddyfile ¶
UnmarshCaddyfile configures the handler directive from Caddyfile. Syntax:
webhook [<url> <path>] {
repo <text>
path <text>
branch <text>
depth <int>
type <text>
secret <text>
command <text>...
key <text>
username <text>
password <text>
token <text>
submodule
}
Click to show internal directories.
Click to hide internal directories.