services

package
v0.0.0-...-89cf25c Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChannel

func GetChannel(userId string) string

Types

type KafkaService

type KafkaService struct {
	Consumer *kafka.Consumer
	Config   *kafka.ConfigMap
}

func NewKafkaService

func NewKafkaService(brokers string, groupId string) (*KafkaService, error)

Creates a new KafkaService instance

func (*KafkaService) Close

func (s *KafkaService) Close()

func (*KafkaService) ConsumeMessages

func (s *KafkaService) ConsumeMessages(handler func(msg kafka.Message)) error

Consumes messages from subscribed topics in a loop

func (*KafkaService) Subscribe

func (s *KafkaService) Subscribe(topics []string) error

Subscribes to a list of Kafka topics

func (*KafkaService) Unsubscribe

func (s *KafkaService) Unsubscribe() error

Unsubscribes from Kafka topics

type User

type User struct {
	ID string
}

func GetCurrentUser

func GetCurrentUser(c *websocket.Conn) (*User, error)

Jump to

Keyboard shortcuts

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