server

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package server implement an echo server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	echopb.UnimplementedEchoServiceServer

	// prevents a package cycle. DO NOT set this to anything other
	// than the real thing.
	ContextAuthEntity func(ctx context.Context) interface{}
	// contains filtered or unexported fields
}

Server implements a simple echo service.

func (*Server) Echo

func (srv *Server) Echo(ctx context.Context, req *echopb.EchoRequest) (*echopb.EchoResponse, error)

Echo responds back with the same message.

func (*Server) EchoBiDi

func (srv *Server) EchoBiDi(server echopb.EchoService_EchoBiDiServer) error

EchoBiDi responds back with the same message one character at a time for each message sent to it.

func (*Server) EchoMultiple

EchoMultiple responds back with the same message one character at a time.

func (*Server) SetAuthorized added in v0.0.3

func (srv *Server) SetAuthorized(authorized bool)

SetAuthorized instructs the server to check authorization at certain points.

func (*Server) SetFail

func (srv *Server) SetFail(fail bool)

SetFail instructs the server to fail at certain points in its execution.

Directories

Path Synopsis
Package main runs a gRPC server running the proto/rpc/examples/echo/v1 service.
Package main runs a gRPC server running the proto/rpc/examples/echo/v1 service.

Jump to

Keyboard shortcuts

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