websocket

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command string
const (
	Attach Command = "__attach"
	Detach Command = "__detach"
)

type Event

type Event struct {
	Scope   apistructs.Scope `json:"scope"`
	Type    string           `json:"type"`
	Payload interface{}      `json:"payload"`
}

type Manager

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

func New

func New() (*Manager, error)

func (*Manager) Handle

func (m *Manager) Handle(session sockjs.Session)

func (*Manager) Start

func (m *Manager) Start()

func (*Manager) Stop

func (m *Manager) Stop()

type Protocol

type Protocol struct {
	Scope   apistructs.Scope `json:"scope"`
	Command Command          `json:"command"`
}

type Publisher

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

func NewPublisher

func NewPublisher() (*Publisher, error)

func (*Publisher) EmitEvent

func (p *Publisher) EmitEvent(ctx context.Context, e Event) error

type Subscriber

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

func NewSubscriber

func NewSubscriber(ec chan *Event) (*Subscriber, error)

func (*Subscriber) Start

func (s *Subscriber) Start()

func (*Subscriber) Stop

func (s *Subscriber) Stop()

Jump to

Keyboard shortcuts

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