models

package
v0.0.0-...-7681847 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() *gorm.DB

Connect to mysql databse instance

func Dispatch

func Dispatch(eventID string, payload map[string]interface{})

Dispatch : Fire a specific event to send all subscriber webhook a post request with the provided payload

Types

type Event

type Event struct {
	gorm.Model
	EventID     string
	RetryPolicy string
}

Event Table for storing events to subscribe to

func (Event) NotifySubscribers

func (e Event) NotifySubscribers(payload map[string]interface{})

NotifySubscribers trigger all http subscribers tied to the event being set

type Subscription

type Subscription struct {
	gorm.Model
	Webhook string
	Headers string
	Event   string
}

Subscription table storing urls to be fired upon event

func (Subscription) Notify

func (s Subscription) Notify(payload map[string]interface{}, retryPolicy string)

Notify : Trigger Subscriber by calling its webhook

Jump to

Keyboard shortcuts

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