realtime

package
v0.0.0-...-38b1c69 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyMaxNumberTopic = errors.New("the maximum number has already been created topics")

Functions

func NewKafkaBroker

func NewKafkaBroker(node *Node, cfg KafkaConfig) (*kafkaBroker, error)

Types

type Broker

type Broker interface {
	Publish(topic string, channel string, message []byte) error
	Close()
}

type Channel

type Channel struct {
	Name  string
	Topic string
}

type Client

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

type KafkaConfig

type KafkaConfig struct {
	Addres            []string
	PartitionsOnTopic int
	MaxNumTopic       int
}

type Node

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

func NewNode

func NewNode() (*Node, error)

func (*Node) AddSubscriber

func (n *Node) AddSubscriber(c *rt.Channel, client *Client)

func (*Node) SendOut

func (n *Node) SendOut(channel Channel, message []byte)

type Server

type Server struct {
	rt.UnimplementedRealTimeServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(node *Node) Server

func (Server) Publish

func (s Server) Publish(ctx context.Context, pm *rt.PublishMessage) (*empty.Empty, error)

func (Server) Subscribe

func (s Server) Subscribe(chans *rt.Channels, ss rt.RealTime_SubscribeServer) error

type SubscriberHub

type SubscriberHub map[Channel]map[string]*Client

Jump to

Keyboard shortcuts

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