webhooks

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManagementHandler added in v0.18.0

func NewManagementHandler(
	svc *management.Service,
	logger *zap.Logger,
) handler.Handler

NewManagementHandler wires the management handler.

Types

type Actor

type Actor struct {
	Nickname    string `json:"nickname"`
	DisplayName string `json:"display_name"`
	UUID        string `json:"uuid"`
}

type Change

type Change struct {
	Commits []Commit `json:"commits"`
	New     *Ref     `json:"new,omitempty"`
	Old     *Ref     `json:"old,omitempty"`
}

type Commit

type Commit struct {
	Hash    string `json:"hash"`
	Message string `json:"message"`
	Author  Actor  `json:"author"`
	Date    string `json:"date"`
}

type Handler

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

func NewHandler

func NewHandler(
	svc *webhooks.Service,
	logger *zap.Logger,
) *Handler

func (*Handler) Register

func (h *Handler) Register(r fiber.Router)
type Link struct {
	Href string `json:"href"`
}

type ManagementHandler added in v0.18.0

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

ManagementHandler serves the admin-only project webhook management endpoints. It is registered through the group:"handlers" fx path, after the JWT middleware.

func (*ManagementHandler) Register added in v0.18.0

func (h *ManagementHandler) Register(r fiber.Router)

Register wires the admin-only webhook management routes.

type PushData

type PushData struct {
	Changes []Change `json:"changes"`
}

type PushEvent

type PushEvent struct {
	Push       PushData   `json:"push"`
	Repository Repository `json:"repository"`
	Actor      Actor      `json:"actor"`
}

type Ref

type Ref struct {
	Type   string `json:"type"`
	Name   string `json:"name"`
	Target Commit `json:"target"`
}
type RepoLinks struct {
	Self Link `json:"self"`
}

type Repository

type Repository struct {
	FullName string    `json:"full_name"`
	Name     string    `json:"name"`
	UUID     string    `json:"uuid"`
	Scm      string    `json:"scm"`
	Links    RepoLinks `json:"links"`
}

type WebhookStatusResponse added in v0.18.0

type WebhookStatusResponse struct {
	Status        string  `json:"status"         example:"registered"`
	HookUUID      *string `json:"hook_uuid"      example:"{abc-123}"`
	CallbackURL   string  `json:"callback_url"   example:"https://bitissues.example.com/api/v1/webhooks/bitbucket/push"`
	FailureReason *string `json:"failure_reason" example:"Bitbucket OAuth is not connected"`
	UpdatedAt     *string `json:"updated_at"     example:"2026-09-29T12:00:00Z"`
}

WebhookStatusResponse implements the canonical webhook contract success body. Status is one of registered, not_registered, failed, unavailable.

func NewWebhookStatusResponse added in v0.18.0

func NewWebhookStatusResponse(st *management.WebhookStatus) WebhookStatusResponse

NewWebhookStatusResponse maps a management status to the wire DTO.

Jump to

Keyboard shortcuts

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