~bigbes/sr-ht-spec

ref: 46048cbc0ada700c621b7c73d8da07deefde2662 sr-ht-spec/service/events.go -rw-r--r-- 685 bytes
46048cbc — Eugene Blikh chore(beads): spec-ejq.2 re-index verified against repo.bigb.es 13 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package service

// ProposalEventKind names a proposal lifecycle event. The values equal the
// graph WebhookEvent enum values so the surface maps them without a table.
type ProposalEventKind string

const (
	EventProposalOpened   ProposalEventKind = "PROPOSAL_OPENED"
	EventProposalMerged   ProposalEventKind = "PROPOSAL_MERGED"
	EventProposalRejected ProposalEventKind = "PROPOSAL_REJECTED"
)

// EventSink receives proposal lifecycle events for out-of-band delivery
// (webhooks). It is optional: a Service with no sink emits nothing. The sink
// must not block — implementations enqueue and return.
type EventSink interface {
	ProposalEvent(kind ProposalEventKind, p Proposal)
}