helloworld

package
v0.97.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package helloworld is a generated protocol buffer package.

It is generated from these files:

greeter.proto

It has these top-level messages:

HelloRequest
HelloReply

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGreeterServer

func RegisterGreeterServer(s *grpc.Server, srv GreeterServer)

Types

type CallType

type CallType string

CallType represents one of the gRPC call types: unary, client streaming, server streaming, bidi

var Bidi CallType = "bidi"

Bidi is a bidi / duplex call

var ClientStream CallType = "cs"

ClientStream is a client streaming call

var ServerStream CallType = "ss"

ServerStream is a server streaming call

var Unary CallType = "unary"

Unary is a unary call

type Greeter

type Greeter struct {
	StreamData []*HelloReply

	Stats *HWStatsHandler
	// contains filtered or unexported fields
}

Greeter implements the GreeterServer for tests

func NewGreeter

func NewGreeter() *Greeter

NewGreeter creates new greeter server

func (*Greeter) GetCalls added in v0.96.0

func (s *Greeter) GetCalls(key CallType) [][]*HelloRequest

GetCalls gets the received messages for specific call type

func (*Greeter) GetConnectionCount added in v0.96.0

func (s *Greeter) GetConnectionCount() int

GetConnectionCount gets the connection count

func (*Greeter) GetCount

func (s *Greeter) GetCount(key CallType) int

GetCount gets the count for specific call type

func (*Greeter) GetCountByWorker added in v0.96.0

func (s *Greeter) GetCountByWorker(key CallType) map[string]int

GetCountByWorker gets count of requests by goroutine

func (*Greeter) GetSendCounts added in v0.96.0

func (s *Greeter) GetSendCounts(key CallType) map[int]int

GetSendCounts gets the stream send counts

func (*Greeter) ResetCounters

func (s *Greeter) ResetCounters()

ResetCounters resets the call counts

func (*Greeter) SayHello

func (s *Greeter) SayHello(ctx context.Context, in *HelloRequest) (*HelloReply, error)

SayHello implements helloworld.GreeterServer

func (*Greeter) SayHelloBidi

func (s *Greeter) SayHelloBidi(stream Greeter_SayHelloBidiServer) error

SayHelloBidi duplex call handler

func (*Greeter) SayHelloCS

func (s *Greeter) SayHelloCS(stream Greeter_SayHelloCSServer) error

SayHelloCS is client streaming handler

func (*Greeter) SayHellos

func (s *Greeter) SayHellos(req *HelloRequest, stream Greeter_SayHellosServer) error

SayHellos lists all hellos

type GreeterClient

type GreeterClient interface {
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
	SayHelloCS(ctx context.Context, opts ...grpc.CallOption) (Greeter_SayHelloCSClient, error)
	SayHellos(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (Greeter_SayHellosClient, error)
	SayHelloBidi(ctx context.Context, opts ...grpc.CallOption) (Greeter_SayHelloBidiClient, error)
}

func NewGreeterClient

func NewGreeterClient(cc *grpc.ClientConn) GreeterClient

type GreeterServer

type GreeterServer interface {
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
	SayHelloCS(Greeter_SayHelloCSServer) error
	SayHellos(*HelloRequest, Greeter_SayHellosServer) error
	SayHelloBidi(Greeter_SayHelloBidiServer) error
}

type Greeter_SayHelloBidiClient

type Greeter_SayHelloBidiClient interface {
	Send(*HelloRequest) error
	Recv() (*HelloReply, error)
	grpc.ClientStream
}

type Greeter_SayHelloBidiServer

type Greeter_SayHelloBidiServer interface {
	Send(*HelloReply) error
	Recv() (*HelloRequest, error)
	grpc.ServerStream
}

type Greeter_SayHelloCSClient

type Greeter_SayHelloCSClient interface {
	Send(*HelloRequest) error
	CloseAndRecv() (*HelloReply, error)
	grpc.ClientStream
}

type Greeter_SayHelloCSServer

type Greeter_SayHelloCSServer interface {
	SendAndClose(*HelloReply) error
	Recv() (*HelloRequest, error)
	grpc.ServerStream
}

type Greeter_SayHellosClient

type Greeter_SayHellosClient interface {
	Recv() (*HelloReply, error)
	grpc.ClientStream
}

type Greeter_SayHellosServer

type Greeter_SayHellosServer interface {
	Send(*HelloReply) error
	grpc.ServerStream
}

type HWStatsHandler added in v0.96.0

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

HWStatsHandler is for gRPC stats

func NewHWStats added in v0.96.0

func NewHWStats() *HWStatsHandler

NewHWStats creates new stats handler

func (*HWStatsHandler) GetConnectionCount added in v0.96.0

func (c *HWStatsHandler) GetConnectionCount() int

GetConnectionCount gets the connection count

func (*HWStatsHandler) HandleConn added in v0.96.0

func (c *HWStatsHandler) HandleConn(ctx context.Context, cs stats.ConnStats)

HandleConn handle the connection

func (*HWStatsHandler) HandleRPC added in v0.96.0

func (c *HWStatsHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)

HandleRPC implements per-RPC tracing and stats instrumentation.

func (*HWStatsHandler) TagConn added in v0.96.0

TagConn exists to satisfy gRPC stats.Handler.

func (*HWStatsHandler) TagRPC added in v0.96.0

TagRPC implements per-RPC context management.

type HelloReply

type HelloReply struct {
	Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}

The response message containing the greetings

func (*HelloReply) Descriptor

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

func (*HelloReply) GetMessage

func (m *HelloReply) GetMessage() string

func (*HelloReply) ProtoMessage

func (*HelloReply) ProtoMessage()

func (*HelloReply) Reset

func (m *HelloReply) Reset()

func (*HelloReply) String

func (m *HelloReply) String() string

type HelloRequest

type HelloRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}

The request message containing the user's name.

func (*HelloRequest) Descriptor

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

func (*HelloRequest) GetName

func (m *HelloRequest) GetName() string

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) Reset

func (m *HelloRequest) Reset()

func (*HelloRequest) String

func (m *HelloRequest) String() string

Jump to

Keyboard shortcuts

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