notifier

package
v0.0.0-...-fd55db2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaNotifier

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

KafkaNotifier represents the Kafka notifier.

func NewKafkaNotifier

func NewKafkaNotifier(bootstrapServers, topic string) (*KafkaNotifier, error)

NewKafkaNotifier creates a new instance of KafkaNotifier.

func (*KafkaNotifier) Close

func (n *KafkaNotifier) Close() error

func (*KafkaNotifier) NotifyUserChange

func (n *KafkaNotifier) NotifyUserChange(eventType UserEventType, user *domain.User) error

type UserEvent

type UserEvent struct {
	Type   UserEventType `json:"type"`
	UserID string        `json:"user_id"`
	User   *domain.User  `json:"user,omitempty"`
}

type UserEventType

type UserEventType string
var (
	Created UserEventType = "CREATED"
	Updated UserEventType = "UPDATED"
	Deleted UserEventType = "DELETED"
)

type UserNotifier

type UserNotifier interface {
	NotifyUserChange(eventType UserEventType, user *domain.User) error
}

UserNotifier represents the user notifier.

Jump to

Keyboard shortcuts

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