websocket

package
v0.7.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

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