rpc

package
v0.0.0-...-f6cd02a Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2016 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadCast = errors.New("bad cast from gregor type to protocol type")

ErrBadCast occurs when there is a problem casting a type from gregor to protocol.

View Source
var ErrBadUID = errors.New("bad UID on channel")

ErrBadUID occurs when there is a bad UID on the auth channel.

Functions

func IsSocketClosedError

func IsSocketClosedError(e error) bool

IsSocketClosedError returns true if e looks like an error due to the socket being closed. net.errClosing isn't exported, so do this.. UGLY!

Types

type Authenticator

type Authenticator interface {
	Authenticate(ctx context.Context, tok protocol.AuthToken) (protocol.UID, protocol.SessionID, error)
}

Authenticator is an interface for handling authentication.

type Server

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

Server is an RPC server that implements gregor.NetworkInterfaceOutgoing and gregor.NetworkInterface.

func NewServer

func NewServer() *Server

NewServer creates a Server. You must call ListenLoop(...) and Serve(...) for it to be functional.

func (*Server) BroadcastMessage

func (s *Server) BroadcastMessage(c context.Context, m gregor.Message) error

BroadcastMessage implements gregor.NetworkInterfaceOutgoing.

func (*Server) ListenLoop

func (s *Server) ListenLoop(l net.Listener) error

ListenLoop listens for new connections on net.Listener.

func (*Server) Serve

Serve starts the serve loop for Server.

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown tells the server to stop its Serve loop.

type Stats

type Stats struct {
	UserServerCount int
}

Stats contains information about the current state of the server.

Jump to

Keyboard shortcuts

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