calculatorpb

package
v0.0.0-...-aa1e05c Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package calculatorpb is a generated twirp stub package. This code was generated with github.com/twitchtv/twirp/protoc-gen-twirp v7.1.0.

It is generated from these files:

calculator/calculatorpb/calculator.proto

Index

Constants

View Source
const CalculateSumServicePathPrefix = "/twirp/calculator.CalculateSumService/"

CalculateSumServicePathPrefix is a convenience constant that could used to identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, that add a "/twirp" prefix by default, and use CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

Variables

View Source
var File_calculator_calculatorpb_calculator_proto protoreflect.FileDescriptor

Functions

func RegisterCalculateSumServiceServer

func RegisterCalculateSumServiceServer(s *grpc.Server, srv CalculateSumServiceServer)

func WriteError

func WriteError(resp http.ResponseWriter, err error)

WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

Types

type CalculateSumRequest

type CalculateSumRequest struct {
	Numbers *Numbers `protobuf:"bytes,1,opt,name=numbers,proto3" json:"numbers,omitempty"`
	// contains filtered or unexported fields
}

func (*CalculateSumRequest) Descriptor deprecated

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

Deprecated: Use CalculateSumRequest.ProtoReflect.Descriptor instead.

func (*CalculateSumRequest) GetNumbers

func (x *CalculateSumRequest) GetNumbers() *Numbers

func (*CalculateSumRequest) ProtoMessage

func (*CalculateSumRequest) ProtoMessage()

func (*CalculateSumRequest) ProtoReflect

func (x *CalculateSumRequest) ProtoReflect() protoreflect.Message

func (*CalculateSumRequest) Reset

func (x *CalculateSumRequest) Reset()

func (*CalculateSumRequest) String

func (x *CalculateSumRequest) String() string

type CalculateSumResponse

type CalculateSumResponse struct {
	Sum int32 `protobuf:"varint,1,opt,name=sum,proto3" json:"sum,omitempty"`
	// contains filtered or unexported fields
}

func (*CalculateSumResponse) Descriptor deprecated

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

Deprecated: Use CalculateSumResponse.ProtoReflect.Descriptor instead.

func (*CalculateSumResponse) GetSum

func (x *CalculateSumResponse) GetSum() int32

func (*CalculateSumResponse) ProtoMessage

func (*CalculateSumResponse) ProtoMessage()

func (*CalculateSumResponse) ProtoReflect

func (x *CalculateSumResponse) ProtoReflect() protoreflect.Message

func (*CalculateSumResponse) Reset

func (x *CalculateSumResponse) Reset()

func (*CalculateSumResponse) String

func (x *CalculateSumResponse) String() string

type CalculateSumService

func NewCalculateSumServiceJSONClient

func NewCalculateSumServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) CalculateSumService

NewCalculateSumServiceJSONClient creates a JSON client that implements the CalculateSumService interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewCalculateSumServiceProtobufClient

func NewCalculateSumServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) CalculateSumService

NewCalculateSumServiceProtobufClient creates a Protobuf client that implements the CalculateSumService interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type CalculateSumServiceClient

type CalculateSumServiceClient interface {
	CalculateSum(ctx context.Context, in *CalculateSumRequest, opts ...grpc.CallOption) (*CalculateSumResponse, error)
	StreamAvg(ctx context.Context, opts ...grpc.CallOption) (CalculateSumService_StreamAvgClient, error)
	FindMaximum(ctx context.Context, opts ...grpc.CallOption) (CalculateSumService_FindMaximumClient, error)
	SquareRoot(ctx context.Context, in *SquareRootRequest, opts ...grpc.CallOption) (*SquareRootResponse, error)
}

CalculateSumServiceClient is the client API for CalculateSumService service.

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

type CalculateSumServiceServer

CalculateSumServiceServer is the server API for CalculateSumService service.

type CalculateSumService_FindMaximumClient

type CalculateSumService_FindMaximumClient interface {
	Send(*FindMaximumRequest) error
	Recv() (*FindMaximumResponse, error)
	grpc.ClientStream
}

type CalculateSumService_FindMaximumServer

type CalculateSumService_FindMaximumServer interface {
	Send(*FindMaximumResponse) error
	Recv() (*FindMaximumRequest, error)
	grpc.ServerStream
}

type CalculateSumService_StreamAvgClient

type CalculateSumService_StreamAvgClient interface {
	Send(*StreamAvgRequest) error
	CloseAndRecv() (*StreamAvgResponse, error)
	grpc.ClientStream
}

type CalculateSumService_StreamAvgServer

type CalculateSumService_StreamAvgServer interface {
	SendAndClose(*StreamAvgResponse) error
	Recv() (*StreamAvgRequest, error)
	grpc.ServerStream
}

type FindMaximumRequest

type FindMaximumRequest struct {
	Number int64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

func (*FindMaximumRequest) Descriptor deprecated

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

Deprecated: Use FindMaximumRequest.ProtoReflect.Descriptor instead.

func (*FindMaximumRequest) GetNumber

func (x *FindMaximumRequest) GetNumber() int64

func (*FindMaximumRequest) ProtoMessage

func (*FindMaximumRequest) ProtoMessage()

func (*FindMaximumRequest) ProtoReflect

func (x *FindMaximumRequest) ProtoReflect() protoreflect.Message

func (*FindMaximumRequest) Reset

func (x *FindMaximumRequest) Reset()

func (*FindMaximumRequest) String

func (x *FindMaximumRequest) String() string

type FindMaximumResponse

type FindMaximumResponse struct {
	Maximum int64 `protobuf:"varint,1,opt,name=maximum,proto3" json:"maximum,omitempty"`
	// contains filtered or unexported fields
}

func (*FindMaximumResponse) Descriptor deprecated

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

Deprecated: Use FindMaximumResponse.ProtoReflect.Descriptor instead.

func (*FindMaximumResponse) GetMaximum

func (x *FindMaximumResponse) GetMaximum() int64

func (*FindMaximumResponse) ProtoMessage

func (*FindMaximumResponse) ProtoMessage()

func (*FindMaximumResponse) ProtoReflect

func (x *FindMaximumResponse) ProtoReflect() protoreflect.Message

func (*FindMaximumResponse) Reset

func (x *FindMaximumResponse) Reset()

func (*FindMaximumResponse) String

func (x *FindMaximumResponse) String() string

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.

HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.

type Numbers

type Numbers struct {
	Numbers []int32 `protobuf:"varint,1,rep,packed,name=numbers,proto3" json:"numbers,omitempty"`
	// contains filtered or unexported fields
}

func (*Numbers) Descriptor deprecated

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

Deprecated: Use Numbers.ProtoReflect.Descriptor instead.

func (*Numbers) GetNumbers

func (x *Numbers) GetNumbers() []int32

func (*Numbers) ProtoMessage

func (*Numbers) ProtoMessage()

func (*Numbers) ProtoReflect

func (x *Numbers) ProtoReflect() protoreflect.Message

func (*Numbers) Reset

func (x *Numbers) Reset()

func (*Numbers) String

func (x *Numbers) String() string

type SquareRootRequest

type SquareRootRequest struct {
	Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

func (*SquareRootRequest) Descriptor deprecated

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

Deprecated: Use SquareRootRequest.ProtoReflect.Descriptor instead.

func (*SquareRootRequest) GetNumber

func (x *SquareRootRequest) GetNumber() int32

func (*SquareRootRequest) ProtoMessage

func (*SquareRootRequest) ProtoMessage()

func (*SquareRootRequest) ProtoReflect

func (x *SquareRootRequest) ProtoReflect() protoreflect.Message

func (*SquareRootRequest) Reset

func (x *SquareRootRequest) Reset()

func (*SquareRootRequest) String

func (x *SquareRootRequest) String() string

type SquareRootResponse

type SquareRootResponse struct {
	NumberRoot float64 `protobuf:"fixed64,1,opt,name=number_root,json=numberRoot,proto3" json:"number_root,omitempty"`
	// contains filtered or unexported fields
}

func (*SquareRootResponse) Descriptor deprecated

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

Deprecated: Use SquareRootResponse.ProtoReflect.Descriptor instead.

func (*SquareRootResponse) GetNumberRoot

func (x *SquareRootResponse) GetNumberRoot() float64

func (*SquareRootResponse) ProtoMessage

func (*SquareRootResponse) ProtoMessage()

func (*SquareRootResponse) ProtoReflect

func (x *SquareRootResponse) ProtoReflect() protoreflect.Message

func (*SquareRootResponse) Reset

func (x *SquareRootResponse) Reset()

func (*SquareRootResponse) String

func (x *SquareRootResponse) String() string

type StreamAvgRequest

type StreamAvgRequest struct {
	Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamAvgRequest) Descriptor deprecated

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

Deprecated: Use StreamAvgRequest.ProtoReflect.Descriptor instead.

func (*StreamAvgRequest) GetNumber

func (x *StreamAvgRequest) GetNumber() int32

func (*StreamAvgRequest) ProtoMessage

func (*StreamAvgRequest) ProtoMessage()

func (*StreamAvgRequest) ProtoReflect

func (x *StreamAvgRequest) ProtoReflect() protoreflect.Message

func (*StreamAvgRequest) Reset

func (x *StreamAvgRequest) Reset()

func (*StreamAvgRequest) String

func (x *StreamAvgRequest) String() string

type StreamAvgResponse

type StreamAvgResponse struct {
	Average float32 `protobuf:"fixed32,1,opt,name=average,proto3" json:"average,omitempty"`
	// contains filtered or unexported fields
}

func (*StreamAvgResponse) Descriptor deprecated

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

Deprecated: Use StreamAvgResponse.ProtoReflect.Descriptor instead.

func (*StreamAvgResponse) GetAverage

func (x *StreamAvgResponse) GetAverage() float32

func (*StreamAvgResponse) ProtoMessage

func (*StreamAvgResponse) ProtoMessage()

func (*StreamAvgResponse) ProtoReflect

func (x *StreamAvgResponse) ProtoReflect() protoreflect.Message

func (*StreamAvgResponse) Reset

func (x *StreamAvgResponse) Reset()

func (*StreamAvgResponse) String

func (x *StreamAvgResponse) String() string

type TwirpServer

type TwirpServer interface {
	http.Handler

	// ServiceDescriptor returns gzipped bytes describing the .proto file that
	// this service was generated from. Once unzipped, the bytes can be
	// unmarshalled as a
	// github.com/golang/protobuf/protoc-gen-go/descriptor.FileDescriptorProto.
	//
	// The returned integer is the index of this particular service within that
	// FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a
	// low-level field, expected to be used for reflection.
	ServiceDescriptor() ([]byte, int)

	// ProtocGenTwirpVersion is the semantic version string of the version of
	// twirp used to generate this file.
	ProtocGenTwirpVersion() string

	// PathPrefix returns the HTTP URL path prefix for all methods handled by this
	// service. This can be used with an HTTP mux to route Twirp requests.
	// The path prefix is in the form: "/<prefix>/<package>.<Service>/"
	// that is, everything in a Twirp route except for the <Method> at the end.
	PathPrefix() string
}

TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.

func NewCalculateSumServiceServer

func NewCalculateSumServiceServer(svc CalculateSumService, opts ...interface{}) TwirpServer

NewCalculateSumServiceServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

type UnimplementedCalculateSumServiceServer

type UnimplementedCalculateSumServiceServer struct {
}

UnimplementedCalculateSumServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedCalculateSumServiceServer) CalculateSum

func (*UnimplementedCalculateSumServiceServer) FindMaximum

func (*UnimplementedCalculateSumServiceServer) SquareRoot

func (*UnimplementedCalculateSumServiceServer) StreamAvg

Jump to

Keyboard shortcuts

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