Documentation
¶
Overview ¶
Package repositoryevent defines the public, privacy-safe contract used by the Workbench GitHub App to notify enrolled WB daemons about repository changes.
Index ¶
Constants ¶
View Source
const ( ContractVersion = 1 EventsPath = "/v0/workbench/repository-events" AckPath = "/v0/workbench/repository-events/ack" DefaultLimit = 50 MaxLimit = 100 DefaultWaitSeconds = 25 MaxWaitSeconds = 30 MaxCursorBytes = 1024 MaxEventIDBytes = 256 MaxRepositoryBytes = 256 MaxRefBytes = 512 )
Variables ¶
View Source
var ( ErrInvalidEvent = errors.New("invalid repository event") ErrInvalidCursor = errors.New("invalid repository event cursor") )
Functions ¶
func ValidateCursor ¶
func ValidateEventID ¶
func ValidateRepository ¶
Types ¶
type AckRequest ¶
type AckRequest struct {
Version int `json:"version"`
Cursor string `json:"cursor"`
EventIDs []string `json:"event_ids"`
}
func (AckRequest) Validate ¶
func (request AckRequest) Validate() error
type AckResponse ¶
type Event ¶
type Event struct {
Version int `json:"version" firestore:"version"`
ID string `json:"id" firestore:"id"`
Repository string `json:"repository" firestore:"repository"`
PreviousRepository string `json:"previous_repository,omitempty" firestore:"previous_repository,omitempty"`
Ref string `json:"ref" firestore:"ref"`
Reason Reason `json:"reason" firestore:"reason"`
TargetSHA string `json:"target_sha,omitempty" firestore:"target_sha,omitempty"`
OccurredAt *time.Time `json:"occurred_at,omitempty" firestore:"occurred_at,omitempty"`
}
Event is the complete allowlist of GitHub metadata delivered to a WB daemon. It intentionally excludes webhook payloads, installation IDs, credentials, paths, actor identities, commit messages, and diagnostics.
Click to show internal directories.
Click to hide internal directories.