Versions in this module Expand all Collapse all v0 v0.1.4 Oct 4, 2026 Changes in this version + const DefaultTimeout + const EventFailed + const EventSucceeded + const EventWildcard + const HeaderDelivery + const HeaderEvent + const HeaderJob + const HeaderSignature + const HeaderTimestamp + const SignatureVersion + var ErrEventNotSubscribed = errors.New("通知目标未订阅该事件") + var ErrTargetNotFound = errors.New("通知目标未注册") + func KnownEvent(name string) bool + func Retryable(err error) bool + func Signer(secret string, body []byte, timestamp time.Time) string + func Subscribes(events []string, event string) bool + func Verify(secret string, header string, body []byte, timestamp time.Time) bool + type Deliverer struct + func NewDeliverer(registry *Registry, client *http.Client) *Deliverer + func (d *Deliverer) Deliver(ctx context.Context, req Request) error + func (d *Deliverer) SetClock(now func() time.Time) + type Error struct + Delivery string + Err error + Retryable bool + Status int + func (e *Error) Error() string + func (e *Error) Unwrap() error + type Registry struct + func NewRegistry(targets map[string]Target) *Registry + func (r *Registry) Lookup(name string) (Target, bool) + func (r *Registry) Names() []string + type Request struct + Attempt int + Event string + ID string + JobID string + Payload []byte + Target string + type Target struct + Events []string + Secret string + Timeout time.Duration + URL string