session

package
v0.0.0-...-d2e3589 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSessionContext

func SetSessionContext(ctx context.Context, session *Session) context.Context

Types

type Service

type Service interface {
	HandleHello(ctx context.Context, payload *dto.ClientPayload) *dto.ServerResponse
	HandleNewMessage(ctx context.Context, payload *dto.ClientPayload) *dto.ServerResponse
	ProcessPubsubMessage(ctx context.Context, payload dto.PubMessage) *dto.ServerResponse
}

type Session

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

Session holds and represents a single connection to the server It is responsible for maintaining the connection to a client

func NewWebsocketSession

func NewWebsocketSession(conn *websocket.Conn, service Service) *Session

func (*Session) HandleMessage

func (s *Session) HandleMessage(m *nsq.Message) error

func (Session) ID

func (s Session) ID() string

func (*Session) Reader

func (s *Session) Reader(ctx context.Context, span trace.Span)

func (*Session) Stop

func (s *Session) Stop(data interface{})

func (Session) StopChan

func (s Session) StopChan() chan interface{}

func (Session) User

func (s Session) User() string

func (*Session) Writer

func (s *Session) Writer(ctx context.Context, span trace.Span)

Jump to

Keyboard shortcuts

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