hello

package
v0.0.0-...-ead2257 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package hello is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ServiceID_name = map[int32]string{
		0: "UNKNOWN_Service",
		1: "ONE",
		2: "TWO",
		3: "THREE",
	}
	ServiceID_value = map[string]int32{
		"UNKNOWN_Service": 0,
		"ONE":             1,
		"TWO":             2,
		"THREE":           3,
	}
)

Enum value maps for ServiceID.

View Source
var File_github_com_ghazninattarshah_tracing_with_jaeger_gunk_hello_all_proto protoreflect.FileDescriptor
View Source
var HelloService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "hello.HelloService",
	HandlerType: (*HelloServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SayHello",
			Handler:    _HelloService_SayHello_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/ghazninattarshah/tracing-with-jaeger/gunk/hello/all.proto",
}

HelloService_ServiceDesc is the grpc.ServiceDesc for HelloService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterHelloServiceHandler

func RegisterHelloServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterHelloServiceHandler registers the http handlers for service HelloService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterHelloServiceHandlerClient

func RegisterHelloServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HelloServiceClient) error

RegisterHelloServiceHandlerClient registers the http handlers for service HelloService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HelloServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HelloServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HelloServiceClient" to call the correct interceptors.

func RegisterHelloServiceHandlerFromEndpoint

func RegisterHelloServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterHelloServiceHandlerFromEndpoint is same as RegisterHelloServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterHelloServiceHandlerServer

func RegisterHelloServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HelloServiceServer) error

RegisterHelloServiceHandlerServer registers the http handlers for service HelloService to "mux". UnaryRPC :call HelloServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterHelloServiceHandlerFromEndpoint instead.

func RegisterHelloServiceServer

func RegisterHelloServiceServer(s grpc.ServiceRegistrar, srv HelloServiceServer)

Types

type HelloRequest

type HelloRequest struct {

	// Msg is a message from a client.
	Msg string `protobuf:"bytes,1,opt,name=Msg,json=msg,proto3" json:"msg,omitempty"`
	// ServiceID is the service that the hello will be sent to
	ServiceID ServiceID `protobuf:"varint,2,opt,name=ServiceID,json=service_id,proto3,enum=hello.ServiceID" json:"service_id,omitempty"`
	// contains filtered or unexported fields
}

HelloRequest contains an hello request message.

func (*HelloRequest) Descriptor deprecated

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetMsg

func (x *HelloRequest) GetMsg() string

func (*HelloRequest) GetServiceID

func (x *HelloRequest) GetServiceID() ServiceID

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect

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

func (*HelloRequest) Reset

func (x *HelloRequest) Reset()

func (*HelloRequest) String

func (x *HelloRequest) String() string

type HelloResponse

type HelloResponse struct {

	// Msg is a message from a service.
	Msg string `protobuf:"bytes,1,opt,name=Msg,json=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

HelloResponse contains an hello response from specific service.

func (*HelloResponse) Descriptor deprecated

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

Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.

func (*HelloResponse) GetMsg

func (x *HelloResponse) GetMsg() string

func (*HelloResponse) ProtoMessage

func (*HelloResponse) ProtoMessage()

func (*HelloResponse) ProtoReflect

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

func (*HelloResponse) Reset

func (x *HelloResponse) Reset()

func (*HelloResponse) String

func (x *HelloResponse) String() string

type HelloServiceClient

type HelloServiceClient interface {
	// SayHello returns the passed message from respective service
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
}

HelloServiceClient is the client API for HelloService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type HelloServiceServer

type HelloServiceServer interface {
	// SayHello returns the passed message from respective service
	SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
	// contains filtered or unexported methods
}

HelloServiceServer is the server API for HelloService service. All implementations must embed UnimplementedHelloServiceServer for forward compatibility

type ServiceID

type ServiceID int32

ServiceID is identifier that the message shall be sent to

const (
	ServiceID_UNKNOWN_Service ServiceID = 0
	ServiceID_ONE             ServiceID = 1
	ServiceID_TWO             ServiceID = 2
	ServiceID_THREE           ServiceID = 3
)

func (ServiceID) Descriptor

func (ServiceID) Descriptor() protoreflect.EnumDescriptor

func (ServiceID) Enum

func (x ServiceID) Enum() *ServiceID

func (ServiceID) EnumDescriptor deprecated

func (ServiceID) EnumDescriptor() ([]byte, []int)

Deprecated: Use ServiceID.Descriptor instead.

func (ServiceID) Number

func (x ServiceID) Number() protoreflect.EnumNumber

func (ServiceID) String

func (x ServiceID) String() string

func (ServiceID) Type

type UnimplementedHelloServiceServer

type UnimplementedHelloServiceServer struct{}

UnimplementedHelloServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedHelloServiceServer) SayHello

type UnsafeHelloServiceServer

type UnsafeHelloServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeHelloServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HelloServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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