server

package
v0.1.117 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package server implement an echo server used for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCEntityInfo added in v0.1.17

type RPCEntityInfo struct {
	Entity string
	Data   interface{}
}

RPCEntityInfo prevents a package cycle. DO NOT set this to anything other than the real thing.

type Server

type Server struct {
	echopb.UnimplementedEchoServiceServer

	// prevents a package cycle. DO NOT set this to anything other
	// than the real thing.
	MustContextAuthEntity func(ctx context.Context) RPCEntityInfo
	// 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) SetExpectedAuthEntity added in v0.1.5

func (srv *Server) SetExpectedAuthEntity(entity string)

SetExpectedAuthEntity sets the expected auth entity.

func (*Server) SetExpectedAuthEntityData added in v0.1.17

func (srv *Server) SetExpectedAuthEntityData(data interface{})

SetExpectedAuthEntityData sets the expected auth entity data.

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