infrastructure

package
v0.0.0-...-ac35e32 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInAppScheduler

func NewInAppScheduler() gocron.Scheduler

func NewKafkaConsumerConnection

func NewKafkaConsumerConnection(connStr string, cg string, topic string) *kafka.Reader

func NewKafkaProducerConnection

func NewKafkaProducerConnection(connStr string, defaultTopic string) *kafka.Writer

func NewNatsConnection

func NewNatsConnection(connStr string) *nats.Conn

func NewPostgresDB

func NewPostgresDB(connStr string) *gorm.DB

func NewRedisCacheConnection

func NewRedisCacheConnection(appCtx context.Context, connStr string) *redis.Client

func NewS3Session

func NewS3Session(connStr string) *s3.S3

Types

type EventEmitter

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

func NewEventEmitter

func NewEventEmitter() *EventEmitter

func (*EventEmitter) EmitAsync

func (e *EventEmitter) EmitAsync(ctx context.Context, eventName string, data interface{})

EmitAsync emits an event asynchronously

func (*EventEmitter) EmitSync

func (e *EventEmitter) EmitSync(ctx context.Context, eventName string, data interface{})

Emit emits an event synchronously

func (*EventEmitter) On

func (e *EventEmitter) On(eventName string, handler func(context.Context, interface{}))

Jump to

Keyboard shortcuts

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