Help us shape the future of Go! Take the 2026 Go Developer Survey

webhook

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

FILE: internal/webhook/event.go

FILE: internal/webhook/handler.go

FILE: internal/webhook/processor.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventType

type EventType string

EventType representa os tipos de eventos normalizados

const (
	EventTypeComment    EventType = "COMMENT"
	EventTypePRUpdate   EventType = "PR_UPDATE"
	EventTypePRApproved EventType = "PR_APPROVED"
	EventTypePRClosed   EventType = "PR_CLOSED"
	EventTypePing       EventType = "PING"
	EventTypeUnknown    EventType = "UNKNOWN"
)

type Handler

type Handler struct {
	Processor Processor
	Service   *service.DeploymentService
	Provider  string
}

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type NormalizedEvent

type NormalizedEvent struct {
	Type       EventType
	Provider   string
	Repo       string
	PRNumber   int
	Sender     string
	Body       string
	CommitSHA  string
	IsApproved bool
	IsMerged   bool
	Action     string // Raw action para debug
}

NormalizedEvent é o evento unificado entre providers

type Processor

type Processor interface {
	Parse(r *http.Request) (*ProcessorResult, error)
}

Processor extrai e normaliza eventos do payload

type ProcessorResult

type ProcessorResult struct {
	Event       *NormalizedEvent
	ShouldQueue bool
	Message     string
}

ProcessorResult encapsula o resultado do processamento

Directories

Path Synopsis
FILE: internal/webhook/auth/basic.go
FILE: internal/webhook/auth/basic.go
FILE: internal/webhook/providers/azure.go
FILE: internal/webhook/providers/azure.go

Jump to

Keyboard shortcuts

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