hook

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(appConfig *config.AppConfig) error

func Notify added in v1.2.0

func Notify(ctx context.Context, message *sdk.EventHookMessage) (uuid.UUID, error)

enqueues a message to the event hooks service

func SetInstance added in v0.2.2

func SetInstance(i Service)

Types

type EventHookAudit added in v1.3.0

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

func NewAudit added in v1.3.0

func NewAudit(db *gorm.DB) *EventHookAudit

func (*EventHookAudit) IsDuplicate added in v1.3.1

func (r *EventHookAudit) IsDuplicate(message *sdk.EventHookMessage) bool

func (*EventHookAudit) Log added in v1.3.0

func (r *EventHookAudit) Log(message *sdk.EventHookMessage)

type EventHooksProvider

type EventHooksProvider interface {
	// Gets the subscriptions for an event type
	Get() ([]*model.EventHook, error)
}

func NewEventHooksProvider

func NewEventHooksProvider(db *gorm.DB) EventHooksProvider

type NotifyFunc added in v1.3.0

type NotifyFunc func(ctx context.Context, message *sdk.EventHookMessage) (uuid.UUID, error)

notify is the function signature for the event hook Add

type Publisher

type Publisher interface {
	// publishes a message to all web hook subscriptions
	Publish(message *sdk.EventHookMessage) error
}

Publishes event hook messages to all web hooks registered in the system.

func NewEventHookPublisher

func NewEventHookPublisher(subscriptionsProvider EventHooksProvider, recorder *EventHookAudit) Publisher

type Service added in v1.3.0

type Service interface {
	// adds a message to the hooks queue
	Notify(ctx context.Context, message *sdk.EventHookMessage) (uuid.UUID, error)
}

This implementation is to make the semantics clear that this is the lifecycle of a hook message: eventHookMessage --> added to queue --> received --> executed handler (events) --> publish the message using Publisher.Publish() queue for adding hook messages to be published

func NewService added in v1.3.0

func NewService(messageSender messaging.MessageSender) Service

Jump to

Keyboard shortcuts

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