shakesapp

package
v0.0.0-...-4badc5a Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package shakesapp defines a server which can be queried to determined many times a string appears in the works of Shakespeare, and a client which can be used to send load to that server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterShakespeareServiceServer

func RegisterShakespeareServiceServer(s *grpc.Server, srv ShakespeareServiceServer)

func SimulateClient

func SimulateClient(ctx context.Context, addr string, numReqs, reqsInFlight int) error

SimulateClient creates a client which will send load to the server.

Types

type ShakespeareRequest

type ShakespeareRequest struct {
	// query is a substring query.
	Query                string   `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ShakespeareRequest) Descriptor

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

func (*ShakespeareRequest) GetQuery

func (m *ShakespeareRequest) GetQuery() string

func (*ShakespeareRequest) ProtoMessage

func (*ShakespeareRequest) ProtoMessage()

func (*ShakespeareRequest) Reset

func (m *ShakespeareRequest) Reset()

func (*ShakespeareRequest) String

func (m *ShakespeareRequest) String() string

func (*ShakespeareRequest) XXX_DiscardUnknown

func (m *ShakespeareRequest) XXX_DiscardUnknown()

func (*ShakespeareRequest) XXX_Marshal

func (m *ShakespeareRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ShakespeareRequest) XXX_Merge

func (m *ShakespeareRequest) XXX_Merge(src proto.Message)

func (*ShakespeareRequest) XXX_Size

func (m *ShakespeareRequest) XXX_Size() int

func (*ShakespeareRequest) XXX_Unmarshal

func (m *ShakespeareRequest) XXX_Unmarshal(b []byte) error

type ShakespeareResponse

type ShakespeareResponse struct {
	// match_count is the number of matching lines.
	MatchCount           int64    `protobuf:"varint,1,opt,name=match_count,json=matchCount,proto3" json:"match_count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ShakespeareResponse) Descriptor

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

func (*ShakespeareResponse) GetMatchCount

func (m *ShakespeareResponse) GetMatchCount() int64

func (*ShakespeareResponse) ProtoMessage

func (*ShakespeareResponse) ProtoMessage()

func (*ShakespeareResponse) Reset

func (m *ShakespeareResponse) Reset()

func (*ShakespeareResponse) String

func (m *ShakespeareResponse) String() string

func (*ShakespeareResponse) XXX_DiscardUnknown

func (m *ShakespeareResponse) XXX_DiscardUnknown()

func (*ShakespeareResponse) XXX_Marshal

func (m *ShakespeareResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ShakespeareResponse) XXX_Merge

func (m *ShakespeareResponse) XXX_Merge(src proto.Message)

func (*ShakespeareResponse) XXX_Size

func (m *ShakespeareResponse) XXX_Size() int

func (*ShakespeareResponse) XXX_Unmarshal

func (m *ShakespeareResponse) XXX_Unmarshal(b []byte) error

type ShakespeareServiceClient

type ShakespeareServiceClient interface {
	// Accepts a query string and returns the number of lines containing that.
	GetMatchCount(ctx context.Context, in *ShakespeareRequest, opts ...grpc.CallOption) (*ShakespeareResponse, error)
}

ShakespeareServiceClient is the client API for ShakespeareService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ShakespeareServiceServer

type ShakespeareServiceServer interface {
	// Accepts a query string and returns the number of lines containing that.
	GetMatchCount(context.Context, *ShakespeareRequest) (*ShakespeareResponse, error)
}

ShakespeareServiceServer is the server API for ShakespeareService service.

func NewServer

func NewServer() ShakespeareServiceServer

NewServer returns an implementation of the server for ShakespeareService (defined in shakesapp.proto).

type UnimplementedShakespeareServiceServer

type UnimplementedShakespeareServiceServer struct {
}

UnimplementedShakespeareServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedShakespeareServiceServer) GetMatchCount

Jump to

Keyboard shortcuts

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