cmd

package
v1.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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."`
}

func (*CallCmd) Run

func (cmd *CallCmd) Run(ctx server.Cmd) error

Run prints 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."`
}

func (*CallsCmd) Run

func (cmd *CallsCmd) Run(ctx server.Cmd) error

Run prints the calls, as a table, and how many there are after the call

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."`
}

func (*WebhookCmd) Run

func (cmd *WebhookCmd) Run(ctx server.Cmd) error

Run prints 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."`
}

func (*WebhookCreateCmd) Run

func (cmd *WebhookCreateCmd) Run(ctx server.Cmd) error

Run creates the webhook, and prints it, with its URL, or its token, when the server has no public endpoint

type WebhookDeleteCmd

type WebhookDeleteCmd struct {
	ID uint64 `arg:"" name:"id" help:"Serial number of the webhook."`
}

func (*WebhookDeleteCmd) Run

func (cmd *WebhookDeleteCmd) Run(ctx server.Cmd) error

Run deletes the webhook, and prints it, as it was

type WebhookUpdateCmd

type WebhookUpdateCmd struct {
	ID          uint64  `arg:"" name:"id" help:"Serial number of the webhook."`
	Description *string `name:"description" help:"What the webhook is for."`
	Secret      *string `name:"secret" help:"Secret which the service signs its calls with, or empty, to remove it."`
}

func (*WebhookUpdateCmd) Run

func (cmd *WebhookUpdateCmd) Run(ctx server.Cmd) error

Run changes the webhook, and prints it

type WebhooksCmd

type WebhooksCmd struct {
	Session string  `name:"session" help:"Identifier of the session whose webhooks are listed."`
	Offset  uint64  `name:"offset" help:"How many webhooks to skip."`
	Limit   *uint64 `name:"limit" help:"Most webhooks to list."`
}

func (*WebhooksCmd) Run

func (cmd *WebhooksCmd) Run(ctx server.Cmd) error

Run prints the webhooks, as a table, and how many there are

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL