greetpb

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 greetpb 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:

greet/greetpb/greet.proto

Index

Constants

View Source
const GreetServicePathPrefix = "/twirp/greet.GreetService/"

GreetServicePathPrefix 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_greet_greetpb_greet_proto protoreflect.FileDescriptor

Functions

func RegisterGreetServiceServer

func RegisterGreetServiceServer(s *grpc.Server, srv GreetServiceServer)

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 GreetEveryoneRequest

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

func (*GreetEveryoneRequest) Descriptor deprecated

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

Deprecated: Use GreetEveryoneRequest.ProtoReflect.Descriptor instead.

func (*GreetEveryoneRequest) GetGreeting

func (x *GreetEveryoneRequest) GetGreeting() *Greeting

func (*GreetEveryoneRequest) ProtoMessage

func (*GreetEveryoneRequest) ProtoMessage()

func (*GreetEveryoneRequest) ProtoReflect

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

func (*GreetEveryoneRequest) Reset

func (x *GreetEveryoneRequest) Reset()

func (*GreetEveryoneRequest) String

func (x *GreetEveryoneRequest) String() string

type GreetEveryoneResponse

type GreetEveryoneResponse struct {
	Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*GreetEveryoneResponse) Descriptor deprecated

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

Deprecated: Use GreetEveryoneResponse.ProtoReflect.Descriptor instead.

func (*GreetEveryoneResponse) GetResult

func (x *GreetEveryoneResponse) GetResult() string

func (*GreetEveryoneResponse) ProtoMessage

func (*GreetEveryoneResponse) ProtoMessage()

func (*GreetEveryoneResponse) ProtoReflect

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

func (*GreetEveryoneResponse) Reset

func (x *GreetEveryoneResponse) Reset()

func (*GreetEveryoneResponse) String

func (x *GreetEveryoneResponse) String() string

type GreetManyTimeRequest

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

func (*GreetManyTimeRequest) Descriptor deprecated

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

Deprecated: Use GreetManyTimeRequest.ProtoReflect.Descriptor instead.

func (*GreetManyTimeRequest) GetGreeting

func (x *GreetManyTimeRequest) GetGreeting() *Greeting

func (*GreetManyTimeRequest) ProtoMessage

func (*GreetManyTimeRequest) ProtoMessage()

func (*GreetManyTimeRequest) ProtoReflect

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

func (*GreetManyTimeRequest) Reset

func (x *GreetManyTimeRequest) Reset()

func (*GreetManyTimeRequest) String

func (x *GreetManyTimeRequest) String() string

type GreetManyTimeResponse

type GreetManyTimeResponse struct {
	Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*GreetManyTimeResponse) Descriptor deprecated

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

Deprecated: Use GreetManyTimeResponse.ProtoReflect.Descriptor instead.

func (*GreetManyTimeResponse) GetResult

func (x *GreetManyTimeResponse) GetResult() string

func (*GreetManyTimeResponse) ProtoMessage

func (*GreetManyTimeResponse) ProtoMessage()

func (*GreetManyTimeResponse) ProtoReflect

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

func (*GreetManyTimeResponse) Reset

func (x *GreetManyTimeResponse) Reset()

func (*GreetManyTimeResponse) String

func (x *GreetManyTimeResponse) String() string

type GreetRequest

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

func (*GreetRequest) Descriptor deprecated

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

Deprecated: Use GreetRequest.ProtoReflect.Descriptor instead.

func (*GreetRequest) GetGreeting

func (x *GreetRequest) GetGreeting() *Greeting

func (*GreetRequest) ProtoMessage

func (*GreetRequest) ProtoMessage()

func (*GreetRequest) ProtoReflect

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

func (*GreetRequest) Reset

func (x *GreetRequest) Reset()

func (*GreetRequest) String

func (x *GreetRequest) String() string

type GreetResponse

type GreetResponse struct {
	Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*GreetResponse) Descriptor deprecated

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

Deprecated: Use GreetResponse.ProtoReflect.Descriptor instead.

func (*GreetResponse) GetResult

func (x *GreetResponse) GetResult() string

func (*GreetResponse) ProtoMessage

func (*GreetResponse) ProtoMessage()

func (*GreetResponse) ProtoReflect

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

func (*GreetResponse) Reset

func (x *GreetResponse) Reset()

func (*GreetResponse) String

func (x *GreetResponse) String() string

type GreetService

type GreetService interface {
	// Unary
	Greet(context.Context, *GreetRequest) (*GreetResponse, error)

	// Streaming Server
	GreetManyTimes(context.Context, *GreetManyTimeRequest) (*GreetManyTimeResponse, error)

	// Client Streaming
	LongGreet(context.Context, *LongGreetRequest) (*LongGreetResponse, error)

	// Bidirection Streaming
	GreetEveryone(context.Context, *GreetEveryoneRequest) (*GreetEveryoneResponse, error)

	// unary with deadline
	GreetWithDeadline(context.Context, *GreetWithDeadlineRequest) (*GreetWithDeadlineResponse, error)
}

func NewGreetServiceJSONClient

func NewGreetServiceJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) GreetService

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

func NewGreetServiceProtobufClient

func NewGreetServiceProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) GreetService

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

type GreetServiceClient

type GreetServiceClient interface {
	// Unary
	Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error)
	// Streaming Server
	GreetManyTimes(ctx context.Context, in *GreetManyTimeRequest, opts ...grpc.CallOption) (GreetService_GreetManyTimesClient, error)
	// Client Streaming
	LongGreet(ctx context.Context, opts ...grpc.CallOption) (GreetService_LongGreetClient, error)
	// Bidirection Streaming
	GreetEveryone(ctx context.Context, opts ...grpc.CallOption) (GreetService_GreetEveryoneClient, error)
	// unary with deadline
	GreetWithDeadline(ctx context.Context, in *GreetWithDeadlineRequest, opts ...grpc.CallOption) (*GreetWithDeadlineResponse, error)
}

GreetServiceClient is the client API for GreetService service.

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

type GreetServiceServer

type GreetServiceServer interface {
	// Unary
	Greet(context.Context, *GreetRequest) (*GreetResponse, error)
	// Streaming Server
	GreetManyTimes(*GreetManyTimeRequest, GreetService_GreetManyTimesServer) error
	// Client Streaming
	LongGreet(GreetService_LongGreetServer) error
	// Bidirection Streaming
	GreetEveryone(GreetService_GreetEveryoneServer) error
	// unary with deadline
	GreetWithDeadline(context.Context, *GreetWithDeadlineRequest) (*GreetWithDeadlineResponse, error)
}

GreetServiceServer is the server API for GreetService service.

type GreetService_GreetEveryoneClient

type GreetService_GreetEveryoneClient interface {
	Send(*GreetEveryoneRequest) error
	Recv() (*GreetEveryoneResponse, error)
	grpc.ClientStream
}

type GreetService_GreetEveryoneServer

type GreetService_GreetEveryoneServer interface {
	Send(*GreetEveryoneResponse) error
	Recv() (*GreetEveryoneRequest, error)
	grpc.ServerStream
}

type GreetService_GreetManyTimesClient

type GreetService_GreetManyTimesClient interface {
	Recv() (*GreetManyTimeResponse, error)
	grpc.ClientStream
}

type GreetService_GreetManyTimesServer

type GreetService_GreetManyTimesServer interface {
	Send(*GreetManyTimeResponse) error
	grpc.ServerStream
}

type GreetService_LongGreetClient

type GreetService_LongGreetClient interface {
	Send(*LongGreetRequest) error
	CloseAndRecv() (*LongGreetResponse, error)
	grpc.ClientStream
}

type GreetService_LongGreetServer

type GreetService_LongGreetServer interface {
	SendAndClose(*LongGreetResponse) error
	Recv() (*LongGreetRequest, error)
	grpc.ServerStream
}

type GreetWithDeadlineRequest

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

func (*GreetWithDeadlineRequest) Descriptor deprecated

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

Deprecated: Use GreetWithDeadlineRequest.ProtoReflect.Descriptor instead.

func (*GreetWithDeadlineRequest) GetGreeting

func (x *GreetWithDeadlineRequest) GetGreeting() *Greeting

func (*GreetWithDeadlineRequest) ProtoMessage

func (*GreetWithDeadlineRequest) ProtoMessage()

func (*GreetWithDeadlineRequest) ProtoReflect

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

func (*GreetWithDeadlineRequest) Reset

func (x *GreetWithDeadlineRequest) Reset()

func (*GreetWithDeadlineRequest) String

func (x *GreetWithDeadlineRequest) String() string

type GreetWithDeadlineResponse

type GreetWithDeadlineResponse struct {
	Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*GreetWithDeadlineResponse) Descriptor deprecated

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

Deprecated: Use GreetWithDeadlineResponse.ProtoReflect.Descriptor instead.

func (*GreetWithDeadlineResponse) GetResult

func (x *GreetWithDeadlineResponse) GetResult() string

func (*GreetWithDeadlineResponse) ProtoMessage

func (*GreetWithDeadlineResponse) ProtoMessage()

func (*GreetWithDeadlineResponse) ProtoReflect

func (*GreetWithDeadlineResponse) Reset

func (x *GreetWithDeadlineResponse) Reset()

func (*GreetWithDeadlineResponse) String

func (x *GreetWithDeadlineResponse) String() string

type Greeting

type Greeting struct {
	FirstName string `protobuf:"bytes,1,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	LastName  string `protobuf:"bytes,2,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
	// contains filtered or unexported fields
}

func (*Greeting) Descriptor deprecated

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

Deprecated: Use Greeting.ProtoReflect.Descriptor instead.

func (*Greeting) GetFirstName

func (x *Greeting) GetFirstName() string

func (*Greeting) GetLastName

func (x *Greeting) GetLastName() string

func (*Greeting) ProtoMessage

func (*Greeting) ProtoMessage()

func (*Greeting) ProtoReflect

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

func (*Greeting) Reset

func (x *Greeting) Reset()

func (*Greeting) String

func (x *Greeting) 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 LongGreetRequest

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

func (*LongGreetRequest) Descriptor deprecated

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

Deprecated: Use LongGreetRequest.ProtoReflect.Descriptor instead.

func (*LongGreetRequest) GetGreeting

func (x *LongGreetRequest) GetGreeting() *Greeting

func (*LongGreetRequest) ProtoMessage

func (*LongGreetRequest) ProtoMessage()

func (*LongGreetRequest) ProtoReflect

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

func (*LongGreetRequest) Reset

func (x *LongGreetRequest) Reset()

func (*LongGreetRequest) String

func (x *LongGreetRequest) String() string

type LongGreetResponse

type LongGreetResponse struct {
	Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*LongGreetResponse) Descriptor deprecated

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

Deprecated: Use LongGreetResponse.ProtoReflect.Descriptor instead.

func (*LongGreetResponse) GetResult

func (x *LongGreetResponse) GetResult() string

func (*LongGreetResponse) ProtoMessage

func (*LongGreetResponse) ProtoMessage()

func (*LongGreetResponse) ProtoReflect

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

func (*LongGreetResponse) Reset

func (x *LongGreetResponse) Reset()

func (*LongGreetResponse) String

func (x *LongGreetResponse) 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 NewGreetServiceServer

func NewGreetServiceServer(svc GreetService, opts ...interface{}) TwirpServer

NewGreetServiceServer 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 UnimplementedGreetServiceServer

type UnimplementedGreetServiceServer struct {
}

UnimplementedGreetServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedGreetServiceServer) Greet

func (*UnimplementedGreetServiceServer) GreetEveryone

func (*UnimplementedGreetServiceServer) GreetManyTimes

func (*UnimplementedGreetServiceServer) GreetWithDeadline

func (*UnimplementedGreetServiceServer) LongGreet

Jump to

Keyboard shortcuts

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