github

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package github implements the gateway.NotificationAdapter for GitHub webhooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter implements gateway.NotificationAdapter for GitHub webhooks.

func New

func New(secret string) *Adapter

New creates a new GitHub webhook adapter with the given HMAC secret. If secret is empty, signature validation is skipped.

func NewNamed

func NewNamed(name, secret string) *Adapter

NewNamed creates a named GitHub adapter for multi-repo setups (e.g. "github:bc", "github:trade").

func (*Adapter) Channels

func (a *Adapter) Channels() []gateway.ChannelInfo

Channels returns common GitHub event types as discoverable channels.

func (*Adapter) HTTPHandler

func (a *Adapter) HTTPHandler() http.Handler

HTTPHandler returns an http.Handler that validates and processes GitHub webhook payloads.

func (*Adapter) Name

func (a *Adapter) Name() string

func (*Adapter) Start

func (a *Adapter) Start(_ context.Context, handler func(gateway.Notification)) error

Start stores the handler. Webhook adapters do not maintain a connection.

func (*Adapter) Status

func (a *Adapter) Status() gateway.AdapterStatus

Status returns the adapter's connection state.

func (*Adapter) Stop

func (a *Adapter) Stop() error

Stop is a no-op for webhook adapters.

func (*Adapter) Type

func (a *Adapter) Type() gateway.AdapterType

Type returns AdapterWebhook since GitHub delivers events via HTTP POST.

Jump to

Keyboard shortcuts

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