pubsub

package
v0.0.0-...-988442a Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRedisConfigIsEmpty = errors.New("redis config is empty")
	ErrSQLConfigIsEmpty   = errors.New("sql config is empty")
)

Functions

This section is empty.

Types

type Channel

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

func (Channel) NewPublisher

func (pubSub Channel) NewPublisher() message.Publisher

func (Channel) NewSubscriber

func (pubSub Channel) NewSubscriber() message.Subscriber

type Container

type Container interface {
	NewSubscriber() message.Subscriber
	NewPublisher() message.Publisher
}

func NewChannel

func NewChannel() Container

func NewContainer

func NewContainer(
	config ContainerConfig,
) (Container, error)

func NewRedis

func NewRedis(
	redisClient *redis.Client,
) Container

func NewSQL

func NewSQL(
	dbType string,
	dbClient *stdSQL.DB,
) Container

type ContainerConfig

type ContainerConfig struct {
	EventDriver string  `json:"event_driver"`
	RedisAddr   *string `json:"redis_addr"`
	RedisDB     *int    `json:"redis_db"`
	SQLDBType   *string `json:"sql_db_type"`
	SQLUser     *string `json:"sql_user"`
	SQLPass     *string `json:"sql_pass"`
	SQLHost     *string `json:"sql_addr"`
	SQLPort     *string `json:"sql_port"`
	SQLDBName   *string `json:"sqldb_name"`
}

type Redis

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

func (Redis) NewPublisher

func (pubSub Redis) NewPublisher() message.Publisher

func (Redis) NewSubscriber

func (pubSub Redis) NewSubscriber() message.Subscriber

type SQL

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

func (SQL) NewPublisher

func (pubSub SQL) NewPublisher() message.Publisher

func (SQL) NewSubscriber

func (pubSub SQL) NewSubscriber() message.Subscriber

Jump to

Keyboard shortcuts

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