websocket

package
v0.0.0-...-ed06964 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type     string      `json:"type"`
	Resource string      `json:"resource"`
	Event    interface{} `json:"event"`
}

type Message

type Message struct {
	Type     string      `json:"type"`
	Resource string      `json:"resource"`
	Message  interface{} `json:"message"`
}

func ErrorMessage

func ErrorMessage(err error) Message

func SubscriptionSuccess

func SubscriptionSuccess(resource, subscriptionId string) Message

func UnsubscribeSuccess

func UnsubscribeSuccess() Message

type MessageExecutor

type MessageExecutor interface {
	Execute(*websocket.Conn, []byte)
}

func NewSubscribeCommandExecutor

func NewSubscribeCommandExecutor(manager *subscription.Manager, mappers mappings.Mappings) MessageExecutor

func NewUnsubscribeCommandExecutor

func NewUnsubscribeCommandExecutor(manager *subscription.Manager) MessageExecutor

type Router

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

func NewRouter

func NewRouter() *Router

func (*Router) Add

func (r *Router) Add(messageType string, executor MessageExecutor)

func (*Router) Handler

func (r *Router) Handler() http.HandlerFunc

Jump to

Keyboard shortcuts

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