Documentation ¶
Overview ¶
Package notifications is a basic internal notifications module
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the client (configuration)
func (*Client) GetWebhookEndpoint ¶
GetWebhookEndpoint will get the configured webhook endpoint
type ClientInterface ¶
type ClientInterface interface { Debug(on bool) GetWebhookEndpoint() string IsDebug() bool Logger() *zerolog.Logger Notify(ctx context.Context, modelType string, eventType EventType, model interface{}, id string) error }
ClientInterface is the notification client interface
func NewClient ¶
func NewClient(opts ...ClientOps) (ClientInterface, error)
NewClient creates a new client for notifications
type ClientOps ¶
type ClientOps func(c *clientOptions)
ClientOps allow functional options to be supplied that overwrite default client options.
func WithDebugging ¶
func WithDebugging() ClientOps
WithDebugging will set debugging on notifications
func WithLogger ¶
WithLogger will set the logger
func WithNotifications ¶
WithNotifications will set the webhook endpoint
type EventType ¶
type EventType string
EventType event types thrown in Bux
const ( // EventTypeCreate when a new model is created EventTypeCreate EventType = "create" // EventTypeUpdate when a new model is updated EventTypeUpdate EventType = "update" // EventTypeDelete when a new model is deleted EventTypeDelete EventType = "delete" // EventTypeBroadcast when a transaction is broadcasted (sync tx) EventTypeBroadcast EventType = "broadcast" )
Click to show internal directories.
Click to hide internal directories.