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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSignature = errors.New("invalid webhook signature")
)

Functions

func Module

func Module() fx.Option

Types

type Config

type Config struct {
	Secret       string
	BotUserEmail string
}

type ProcessResult

type ProcessResult struct {
	Matched   int `json:"matched"`
	Resolved  int `json:"resolved"`
	Mentioned int `json:"mentioned"`
}

ProcessResult tracks the results of processing a push event.

func NewProcessResult

func NewProcessResult() *ProcessResult

func (*ProcessResult) AddMatched

func (r *ProcessResult) AddMatched()

func (*ProcessResult) AddMentioned

func (r *ProcessResult) AddMentioned()

func (*ProcessResult) AddResolved

func (r *ProcessResult) AddResolved()

type PushCommit

type PushCommit struct {
	Hash    string
	Message string
	Author  string
}

PushCommit is a flattened commit used by the service layer.

type Service

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

func NewService

func NewService(
	cfg Config,
	commitrefSvc *commitref.Service,
	projectsSvc *projects.Service,
	tasksSvc *tasks.Service,
	commentsSvc *comments.Service,
	usersSvc *users.Service,
	logger *zap.Logger,
) (*Service, error)

func (*Service) Init

func (s *Service) Init(ctx context.Context) error

func (*Service) ProcessPushEvent

func (s *Service) ProcessPushEvent(
	ctx context.Context, repoFullName string, commits []PushCommit,
) (*ProcessResult, error)

func (*Service) VerifyPushEvent

func (s *Service) VerifyPushEvent(rawBody []byte, signatureHeader string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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