server

package
v0.0.0-...-9a25d2e Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatServer

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

func (*ChatServer) Channel

func (s *ChatServer) Channel(in *pb.ConnectRequest, stream pb.Chat_ChannelServer) error

func (*ChatServer) Say

func (s *ChatServer) Say(ctx context.Context, in *pb.Text) (*pb.Confirm, error)

func (*ChatServer) Users

func (s *ChatServer) Users(ctx context.Context, in *pb.Empty) (*pb.UserList, error)

func (*ChatServer) Version

func (s *ChatServer) Version(ctx context.Context, in *pb.Empty) (*pb.Confirm, error)

type Connection

type Connection struct {
	User    pb.User
	Streams []*Stream
	Deleted bool
}

func NewConnection

func NewConnection(username string, stream *pb.Chat_ChannelServer) *Connection

func (*Connection) AddStream

func (connect *Connection) AddStream(stream *pb.Chat_ChannelServer)

func (*Connection) Clean

func (connect *Connection) Clean()

func (*Connection) DeleteStream

func (connect *Connection) DeleteStream(server *pb.Chat_ChannelServer)

func (*Connection) NStreams

func (connect *Connection) NStreams() int

type Stream

type Stream struct {
	Server  *pb.Chat_ChannelServer
	Deleted bool
}

func (*Stream) Send

func (stream *Stream) Send(msg *pb.Text) error

Jump to

Keyboard shortcuts

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