gorealtime

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 7 Imported by: 1

README

Golang Realtime Library

ระบบ Realtime ที่ใช้ในการสื่อสารระหว่างระบบ โดยใช้ RabbitMQ และส่งข้อมูลผ่าน Websocket

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Subscribe

func Subscribe(ctxWithCancel context.Context, amqpEndpoint string, scope string, topic string, subscriberID string, filterArgs map[string][]string, returnDataCh chan<- RealtimePayload) error

Types

type AMQPPublisher

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

func NewAMQPPublisher

func NewAMQPPublisher(amqpEndpoint string, scope string) *AMQPPublisher

func (*AMQPPublisher) Publish

func (p *AMQPPublisher) Publish(topic string, payload string, args map[string]string) error

type Publisher

type Publisher interface {
	Publish(topic string, payload string, args map[string]string) error
}

type RealtimePayload

type RealtimePayload struct {
	Scope     string            `json:"scope"`
	Topic     string            `json:"topic"`
	Timestamp time.Time         `json:"timestamp"`
	Args      map[string]string `json:"args"`
	Payload   string            `json:"payload"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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