Documentation
¶
Overview ¶
Package cmd has the webhooks' commands and flags
Package cmd has the webhooks' flags, and their registry, for the server
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallCmd ¶
type CallCmd struct {
ID uint64 `arg:"" name:"id" help:"Serial number of the call."`
}
type CallCommands ¶
type CallCommands struct {
Calls CallsCmd `cmd:"" name:"calls" help:"List the webhooks' calls, oldest first, which were accepted, or refused, or both." group:"WEBHOOK"`
Call CallCmd `cmd:"" name:"call" help:"Print a call, with its headers, and what it sent." group:"WEBHOOK"`
}
CallCommands are the commands which list, and get, the webhooks' calls
type CallsCmd ¶
type CallsCmd struct {
Webhook uint64 `name:"webhook" help:"Serial number of the webhook whose calls are listed."`
Session string `name:"session" help:"Identifier of the session whose webhooks' calls are listed."`
Status string `` /* 127-byte string literal not displayed */
After uint64 `name:"after" help:"Serial number of the call after which they're listed."`
Limit *uint64 `name:"limit" help:"Most calls to list."`
}
type ClientCommands ¶
type ClientCommands struct {
WebhookCommands
CallCommands
}
ClientCommands are the commands which call the webhooks' API
type Flags ¶
type Flags struct{}
Flags are the webhooks' flags for the server, which has none yet
func (Flags) WithWebhook ¶
func (flags Flags) WithWebhook(ctx server.Cmd, srv *servercmd.RunServer, store store.Store, b *broadcaster.Broadcaster, fn func(*registry.Registry) error, opts ...registry.Opt) error
WithWebhook creates the registry of webhooks, of the store, whose changes it publishes to the broadcaster, with the options, after the server's, such as its tracer, registers its HTTP handlers with the server, when there is one, whose webhooks' URLs are of the server's public endpoint, and then calls the function with it, returning any error. The function runs it, so its changes are logged.
type WebhookCmd ¶
type WebhookCmd struct {
ID uint64 `arg:"" name:"id" help:"Serial number of the webhook."`
}
type WebhookCommands ¶
type WebhookCommands struct {
Webhooks WebhooksCmd `cmd:"" name:"webhooks" help:"List the webhooks, newest first." group:"WEBHOOK"`
Webhook WebhookCmd `cmd:"" name:"webhook" help:"Print a webhook." group:"WEBHOOK"`
WebhookCreate WebhookCreateCmd `` /* 130-byte string literal not displayed */
WebhookUpdate WebhookUpdateCmd `cmd:"" name:"webhook-update" help:"Change a webhook's description, or its secret." group:"WEBHOOK"`
WebhookDelete WebhookDeleteCmd `cmd:"" name:"webhook-delete" help:"Delete a webhook, and its calls, so its URL stops working." group:"WEBHOOK"`
}
WebhookCommands are the commands which list, get, create, change and delete the webhooks
type WebhookCreateCmd ¶
type WebhookCreateCmd struct {
Description []string `arg:"" name:"description" help:"What the webhook is for, which can be more than one argument."`
Session string `name:"session" required:"" help:"Identifier of the session which its calls are for."`
Type string `name:"type" help:"Protocol of the service which calls it: generic, github, aftership or pidgeon." default:"generic"`
Secret string `name:"secret" env:"WEBHOOK_SECRET" help:"Secret which the service signs its calls with, when it gives one."`
}
type WebhookDeleteCmd ¶
type WebhookDeleteCmd struct {
ID uint64 `arg:"" name:"id" help:"Serial number of the webhook."`
}