websocket

package
v0.6.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 14 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithMaxTopicSubscriptionsPerClient

func WithMaxTopicSubscriptionsPerClient(maxTopicSubscriptionsPerClient int) options.Option[Service]

Types

type EventHandler

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

func NewEventHandler

func NewEventHandler(pub *publisher.Publisher, publishEvent *event.Event1[*ISCEvent], subscriptionValidator *SubscriptionValidator) *EventHandler

func (*EventHandler) AttachToEvents

func (p *EventHandler) AttachToEvents() context.CancelFunc

type ISCEvent

type ISCEvent struct {
	Kind      publisher.ISCEventType `json:"kind"`
	Issuer    string                 `json:"issuer"`    // (isc.AgentID) nil means issued by the VM
	RequestID string                 `json:"requestID"` // (isc.RequestID)
	ChainID   string                 `json:"chainID"`   // (isc.ChainID)
	Payload   any                    `json:"payload"`
}

func MapISCEvent

func MapISCEvent[T any](iscEvent *publisher.ISCEvent[T], mappedPayload any) *ISCEvent

type Service

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

func NewWebsocketService

func NewWebsocketService(log *logger.Logger, hub *websockethub.Hub, msgTypes []publisher.ISCEventType, pub *publisher.Publisher, opts ...options.Option[Service]) *Service

func (*Service) EventHandler

func (p *Service) EventHandler() *EventHandler

func (*Service) ServeHTTP

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

ServeHTTP serves the websocket.

type SubscriptionValidator

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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