publisherws

package
v0.5.0-alpha.9 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandSubscribe           = "subscribe"
	CommandClientWasSubscribed = "client_subscribed"

	CommandUnsubscribe           = "unsubscribe"
	CommandClientWasUnsubscribed = "client_unsubscribed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseCommand

type BaseCommand struct {
	Command string `json:"command"`
}

type PublisherWebSocket

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

func New

func New(log *logger.Logger, hub *websockethub.Hub, msgTypes []string, publisher *publisher.Publisher) *PublisherWebSocket

func (*PublisherWebSocket) OnClientCreated

func (p *PublisherWebSocket) OnClientCreated(client *websockethub.Client)

func (*PublisherWebSocket) OnConnect

func (p *PublisherWebSocket) OnConnect(client *websockethub.Client, request *http.Request)

func (*PublisherWebSocket) OnDisconnect

func (p *PublisherWebSocket) OnDisconnect(client *websockethub.Client, request *http.Request)

func (*PublisherWebSocket) ServeHTTP

func (p *PublisherWebSocket) ServeHTTP(c echo.Context) error

ServeHTTP serves the websocket. Provide a chainID to filter for a certain chain, provide an empty chain id to get all chain events.

type SubscriptionCommand

type SubscriptionCommand struct {
	Command string `json:"command"`
	Topic   string `json:"topic"`
}

Jump to

Keyboard shortcuts

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