server

package
v0.0.0-...-4d778f5 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server used to receive a connection from another peer.

func New

func New(
	log *logger.Logger,
	self *peers.Peer,
) *Server

New is server constructor.

func (*Server) Greet

func (s *Server) Greet(ctx context.Context, peer *greeter.Peer) (*greeter.Peer, error)

Greet implements greeter.Greeter.

func (*Server) Stream

func (s *Server) Stream(srv chat.Chat_StreamServer) error

Stream implements chat.MessageServer.

func (*Server) Streams

func (s *Server) Streams() <-chan *Stream

Streams returns channel with new streams.

type Stream

type Stream struct {
	chat.Chat_StreamServer

	PeerID string
}

Stream implements messages.Stream

Jump to

Keyboard shortcuts

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