errorstesting

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package errorstesting is a generated protocol buffer package.

It is generated from these files:

empty.proto

It has these top-level messages:

Empty

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTestServiceServer

func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)

Types

type Empty

type Empty struct {
}

func (*Empty) Descriptor

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

type TestContext

type TestContext struct {
	ServerOpts []grpc.ServerOption
	ClientOpts []grpc.DialOption

	Service TestServiceServer
	Client  TestServiceClient
	// contains filtered or unexported fields
}

TestContext is a testing helper for generating a gRPC server and a gRPC client.

func CreateTestContext

func CreateTestContext(t *testing.T) *TestContext

CreateTestContext returns a new TestContext object.

func (*TestContext) AddUnaryServerInterceptor

func (c *TestContext) AddUnaryServerInterceptor(i grpc.UnaryServerInterceptor)

AddUnaryServerInterceptor sets interceptors to a test server.

func (*TestContext) Setup

func (c *TestContext) Setup()

Setup starts a server and creates a client connection.

func (*TestContext) Teardown

func (c *TestContext) Teardown()

Teardown disconnects a client connection and stops a server

type TestServiceClient

type TestServiceClient interface {
	EmptyCall(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
}

func NewTestServiceClient

func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient

type TestServiceServer

type TestServiceServer interface {
	EmptyCall(context.Context, *Empty) (*Empty, error)
}

Jump to

Keyboard shortcuts

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