hook

package
v0.0.0-...-a2cc7b8 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(f *flamego.Flame, path string, h Hooker, ss []sink.Sinker)

Mount mounts the hook and corresponding sink list under the given path.

- If you mount the foo hook handler at /foo, then you go to service foo's webhook setting page and configure the webhook to post events to <<Relay Host>>/foo. - If you want the hook handler at /foo to pass the payload to sink [bar, baz], then you pass the [bar, baz] sink list.

e.g hook.Mount(fs, f, "/foo", fooHook, [barSink, bazSink])

Types

type Hooker

type Hooker interface {
	// contains filtered or unexported methods
}

Hooker is the interface for the webhook originator.

func NewGerrit

func NewGerrit() Hooker

NewGerrit creates a Gerrit hooker

func NewGitHub

func NewGitHub() Hooker

NewGitHub creates a GitHub hooker

type Response

type Response struct {
	// contains filtered or unexported fields
}

Response defines the handler's return value

  • Sets http.StatusOK and payload if you want the coresponding sink list to process the payload.
  • Sets other 2xx code if you want to short-circuit the processing, but you don't want to indicate an error (e.g. skip the processing). You can optionally set a detail to explain the reason. This will show up on the webhook sender's page.
  • Sets other HTTP code and error detail if you do want to indicate an error.

Jump to

Keyboard shortcuts

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