dao

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventListener

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

EventListener represents database event listener.

func NewEventListener

func NewEventListener(ctx context.Context, db *gorm.DB, channel string) (*EventListener, error)

NewEventListener creates new database event listener.

func NewNamespaceListener

func NewNamespaceListener(ctx context.Context, db *gorm.DB) (*EventListener, error)

NewNamespaceListener creates new database event listener for Namespace entity.

func (EventListener) GetChannelName

func (el EventListener) GetChannelName() string

GetChannelName returns current channel name.

func (EventListener) Listen

func (el EventListener) Listen() <-chan string

Listen listens for incoming database events.

type EventListenerProvider

type EventListenerProvider interface {
	// Listen listens for incoming database events.
	Listen() <-chan string
	// GetChannelName returns channel name.
	GetChannelName() string
}

EventListenerProvider provides an interface to work with database event listener.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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