gserv

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2017 License: MIT Imports: 19 Imported by: 1

Documentation

Overview

gRPC server

Index

Constants

View Source
const ProgramName = "gprcServer"

Variables

This section is empty.

Functions

func MainExample

func MainExample()

Types

type PeerServerClass

type PeerServerClass struct {
	GotFile *bchan.Bchan
	// contains filtered or unexported fields
}

func NewPeerServerClass

func NewPeerServerClass(lgs api.LocalGetSet, cfg *ServerConfig) *PeerServerClass

func (*PeerServerClass) IncrementGotFileCount

func (s *PeerServerClass) IncrementGotFileCount()

func (*PeerServerClass) SendFile

func (s *PeerServerClass) SendFile(stream pb.Peer_SendFileServer) (err error)

implement pb.PeerServer interface; the server is receiving a file here,

because the client called SendFile() on the other end.

type ServerConfig

type ServerConfig struct {
	MyID         string
	ExternalHost string // ip address
	InternalHost string // defaults to 127.0.0.1

	// by default we use SSH
	UseTLS bool

	// For when your VPN already provides encryption.
	SkipEncryption bool // turn off both SSH and TLS.

	CertPath string
	KeyPath  string

	ExternalLsnPort int
	InternalLsnPort int
	CpuProfilePath  string

	SshegoCfg *tun.SshegoConfig

	ServerGotGetReply   chan *api.BcastGetReply
	ServerGotSetRequest chan *api.BcastSetRequest

	Halt *idem.Halter

	GrpcServer *grpc.Server

	Cls *PeerServerClass
	// contains filtered or unexported fields
}

func NewServerConfig

func NewServerConfig(myID string) *ServerConfig

func (*ServerConfig) DefineFlags

func (c *ServerConfig) DefineFlags(fs *flag.FlagSet)

func (*ServerConfig) StartGrpcServer

func (cfg *ServerConfig) StartGrpcServer(
	peer api.LocalGetSet,
	sshdReady chan bool,
	myID string,
)

func (*ServerConfig) Stop

func (cfg *ServerConfig) Stop()

func (*ServerConfig) ValidateConfig

func (c *ServerConfig) ValidateConfig() error

Jump to

Keyboard shortcuts

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