msgrouter

package
v0.0.0-...-72177e3 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	C chan Message
}

type Message

type Message struct {
	Type     string `json:"type"`
	UserData string `json:"user_data"`
}

type MsgRouter

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

func NewMsgRouter

func NewMsgRouter() *MsgRouter

func (*MsgRouter) DispatchMessage

func (self *MsgRouter) DispatchMessage(msg Message)

func (*MsgRouter) Subscribe

func (self *MsgRouter) Subscribe(opts ...SubscriptionOption) *Client

func (*MsgRouter) Unsubscribe

func (self *MsgRouter) Unsubscribe(client *Client)

type SubscriptionOption

type SubscriptionOption func(c *Client, msgRouter *MsgRouter)

func NotifyLatest

func NotifyLatest(msgType string) SubscriptionOption

Jump to

Keyboard shortcuts

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