stream

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEventHandler added in v0.6.0

func NewEventHandler(broadcast func(query string, message []byte),
	directMessage func(userID int64, query string, message []byte)) *eventHandler

Types

type BroadcastClient added in v0.0.15

type BroadcastClient interface {
	Broadcast(query string, message []byte)
}

BroadcastClient ...

type Client

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

Client ...

func NewClient added in v0.5.2

func NewClient(server api.StreamService_SubscribeServer, user *m.User) *Client

NewClient ...

func (*Client) Close

func (c *Client) Close()

Close ...

func (*Client) GetUser added in v0.9.5

func (c *Client) GetUser() *m.User

func (*Client) Send

func (c *Client) Send(id, query string, body []byte) (err error)

Send ...

func (*Client) WritePump

func (c *Client) WritePump(f func(*Client, string, string, []byte)) (err error)

WritePump ...

type IDirectMessage added in v0.9.5

type IDirectMessage interface {
	DirectMessage(userId int64, query string, message []byte)
}

IDirectMessage ...

type IStreamClient added in v0.1.1

type IStreamClient interface {
	GetUser() *m.User
	Send(id string, query string, body []byte) error
}

IStreamClient ...

type Stream added in v0.5.2

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

Stream ...

func NewStreamService

func NewStreamService(lc fx.Lifecycle,
	eventBus bus.Bus) (s *Stream)

NewStreamService ...

func (*Stream) Broadcast added in v0.5.2

func (s *Stream) Broadcast(query string, message []byte)

Broadcast ...

func (*Stream) DirectMessage added in v0.9.5

func (s *Stream) DirectMessage(userID int64, query string, message []byte)

DirectMessage ...

func (*Stream) NewConnection added in v0.5.2

func (s *Stream) NewConnection(server api.StreamService_SubscribeServer, user *m.User) error

NewConnection ...

func (*Stream) Recv added in v0.5.2

func (s *Stream) Recv(client *Client, id, query string, b []byte)

Recv ...

func (*Stream) Shutdown added in v0.5.2

func (s *Stream) Shutdown(_ context.Context) error

Shutdown ...

func (*Stream) Start added in v0.5.2

func (s *Stream) Start(_ context.Context) error

Start ...

func (*Stream) Subscribe added in v0.5.2

func (s *Stream) Subscribe(command string, f func(IStreamClient, string, []byte))

Subscribe ...

func (*Stream) UnSubscribe added in v0.5.2

func (s *Stream) UnSubscribe(command string)

UnSubscribe ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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