wsstomper

package module
v0.0.0-...-99fbc49 Latest Latest
Warning

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

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

README

wsstomper

This is a stomp server project using melody websocket

Documentation

Index

Constants

View Source
const (
	SubscriptionIdKey = "subscriptionId"

	ContentTypeJson = "application/json"
	ContentTypeText = "text/plain"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectCheckHeaderHandle

type ConnectCheckHeaderHandle func(header *frame.Header) bool

type NotifyHandler

type NotifyHandler func(session *melody.Session, contentType string, data []byte)

type StompServer

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

func NewStomp

func NewStomp() *StompServer

func (*StompServer) AddConnectCheckHandle

func (stompS *StompServer) AddConnectCheckHandle(handler ConnectCheckHeaderHandle)

func (*StompServer) AddSubscription

func (stompS *StompServer) AddSubscription(destination, subscriptionId string, session *melody.Session)

func (*StompServer) Command

func (stompS *StompServer) Command(session *melody.Session, msg []byte) error

func (*StompServer) NotifyAllSession

func (stompS *StompServer) NotifyAllSession(contentType string, body []byte)

func (*StompServer) SendError

func (stompS *StompServer) SendError(subscriptionId string, body []byte) error

func (*StompServer) SendMessage

func (stompS *StompServer) SendMessage(destination, contentType string, body []byte)

func (*StompServer) SendMessageByRegex

func (stompS *StompServer) SendMessageByRegex(regex, contentType string, body []byte)

func (*StompServer) SendMessageWithCheck

func (stompS *StompServer) SendMessageWithCheck(destination, contentType string, body []byte, check func(session *melody.Session) bool) error

func (*StompServer) UnSubscription

func (stompS *StompServer) UnSubscription(subscriptionId string)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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