helloworld

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package helloworld is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	MyStreamService_RequestPoints_FullMethodName = "/helloworld.MyStreamService/RequestPoints"
	MyStreamService_StreamPoints_FullMethodName  = "/helloworld.MyStreamService/StreamPoints"
)
View Source
const (
	Greeter_SayHello_FullMethodName = "/helloworld.Greeter/SayHello"
)

Variables

View Source
var File_proto_helloworld_helloworld_proto protoreflect.FileDescriptor
View Source
var Greeter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "helloworld.Greeter",
	HandlerType: (*GreeterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SayHello",
			Handler:    _Greeter_SayHello_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/helloworld/helloworld.proto",
}

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

View Source
var MyStreamService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "helloworld.MyStreamService",
	HandlerType: (*MyStreamServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "RequestPoints",
			Handler:       _MyStreamService_RequestPoints_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "StreamPoints",
			Handler:       _MyStreamService_StreamPoints_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "proto/helloworld/helloworld.proto",
}

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

Functions

func AddGreeterServer

func AddGreeterServer(cb fluffy_dozm_di.ContainerBuilder, ctor any)

AddGreeterServer adds the fluffycore aware grpc server

func AddGreeterServerWithExternalRegistration added in v1.0.4

func AddGreeterServerWithExternalRegistration(cb fluffy_dozm_di.ContainerBuilder, ctor any, register func() endpoint.IEndpointRegistration)

AddGreeterServerWithExternalRegistration adds the fluffycore aware grpc server and external registration service. Mainly used for grpc-gateway

func AddMyStreamServiceServer

func AddMyStreamServiceServer(cb fluffy_dozm_di.ContainerBuilder, ctor any)

AddMyStreamServiceServer adds the fluffycore aware grpc server

func AddMyStreamServiceServerWithExternalRegistration added in v1.0.4

func AddMyStreamServiceServerWithExternalRegistration(cb fluffy_dozm_di.ContainerBuilder, ctor any, register func() endpoint.IEndpointRegistration)

AddMyStreamServiceServerWithExternalRegistration adds the fluffycore aware grpc server and external registration service. Mainly used for grpc-gateway

func RegisterGreeterHandler

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

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

func RegisterGreeterHandlerClient

func RegisterGreeterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreeterClient) error

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

func RegisterGreeterHandlerFromEndpoint

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

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

func RegisterGreeterHandlerServer

func RegisterGreeterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreeterServer) error

RegisterGreeterHandlerServer registers the http handlers for service Greeter to "mux". UnaryRPC :call GreeterServer 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 RegisterGreeterHandlerFromEndpoint instead.

func RegisterGreeterServer

func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer)

func RegisterMyStreamServiceHandler

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

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

func RegisterMyStreamServiceHandlerClient

func RegisterMyStreamServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MyStreamServiceClient) error

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

func RegisterMyStreamServiceHandlerFromEndpoint

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

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

func RegisterMyStreamServiceHandlerServer

func RegisterMyStreamServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MyStreamServiceServer) error

RegisterMyStreamServiceHandlerServer registers the http handlers for service MyStreamService to "mux". UnaryRPC :call MyStreamServiceServer 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 RegisterMyStreamServiceHandlerFromEndpoint instead.

func RegisterMyStreamServiceServer

func RegisterMyStreamServiceServer(s grpc.ServiceRegistrar, srv MyStreamServiceServer)

Types

type GreeterClient

type GreeterClient interface {
	// Sends a greeting
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
}

GreeterClient is the client API for Greeter 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.

func NewGreeterClient

func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient

type GreeterFluffyCoreServer added in v1.0.4

GreeterFluffyCoreServer defines the grpc server truct

func (*GreeterFluffyCoreServer) RegisterFluffyCoreGRPCService added in v1.0.8

func (srv *GreeterFluffyCoreServer) RegisterFluffyCoreGRPCService(s *grpc.Server)

RegisterFluffyCoreGRPCService the server with grpc

func (*GreeterFluffyCoreServer) SayHello added in v1.0.4

func (s *GreeterFluffyCoreServer) SayHello(ctx context.Context, request *HelloRequest) (*HelloReply, error)

SayHello...

type GreeterServer

type GreeterServer interface {
	// Sends a greeting
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
	// contains filtered or unexported methods
}

GreeterServer is the server API for Greeter service. All implementations must embed UnimplementedGreeterServer for forward compatibility

type HelloReply

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

The response message containing the greetings

func (*HelloReply) Descriptor deprecated

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

Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.

func (*HelloReply) GetMessage

func (x *HelloReply) GetMessage() string

func (*HelloReply) ProtoMessage

func (*HelloReply) ProtoMessage()

func (*HelloReply) ProtoReflect

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

func (*HelloReply) Reset

func (x *HelloReply) Reset()

func (*HelloReply) String

func (x *HelloReply) String() string

type HelloRequest

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

The request message containing the user's name.

func (*HelloRequest) Descriptor deprecated

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetName

func (x *HelloRequest) GetName() string

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 IFluffyCoreGreeterServer added in v1.0.8

type IFluffyCoreGreeterServer interface {
	GreeterServer
}

IFluffyCoreGreeterServer defines the grpc server

type IFluffyCoreMyStreamServiceServer added in v1.0.8

type IFluffyCoreMyStreamServiceServer interface {
	MyStreamServiceServer
}

IFluffyCoreMyStreamServiceServer defines the grpc server

type MyStreamServiceClient

type MyStreamServiceClient interface {
	// RequestPoints
	// Request: Unary
	// Response: Streaming
	RequestPoints(ctx context.Context, in *PointsRequest, opts ...grpc.CallOption) (MyStreamService_RequestPointsClient, error)
	// Accepts a stream of Points on a route being traversed, returning a
	// RouteSummary when traversal is completed.
	StreamPoints(ctx context.Context, opts ...grpc.CallOption) (MyStreamService_StreamPointsClient, error)
}

MyStreamServiceClient is the client API for MyStreamService 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 MyStreamServiceFluffyCoreServer added in v1.0.4

MyStreamServiceFluffyCoreServer defines the grpc server truct

func (*MyStreamServiceFluffyCoreServer) RegisterFluffyCoreGRPCService added in v1.0.8

func (srv *MyStreamServiceFluffyCoreServer) RegisterFluffyCoreGRPCService(s *grpc.Server)

RegisterFluffyCoreGRPCService the server with grpc

func (*MyStreamServiceFluffyCoreServer) RequestPoints added in v1.0.4

RequestPoints...

func (*MyStreamServiceFluffyCoreServer) StreamPoints added in v1.0.4

StreamPoints...

type MyStreamServiceServer

type MyStreamServiceServer interface {
	// RequestPoints
	// Request: Unary
	// Response: Streaming
	RequestPoints(*PointsRequest, MyStreamService_RequestPointsServer) error
	// Accepts a stream of Points on a route being traversed, returning a
	// RouteSummary when traversal is completed.
	StreamPoints(MyStreamService_StreamPointsServer) error
	// contains filtered or unexported methods
}

MyStreamServiceServer is the server API for MyStreamService service. All implementations must embed UnimplementedMyStreamServiceServer for forward compatibility

type MyStreamService_RequestPointsClient

type MyStreamService_RequestPointsClient interface {
	Recv() (*Point, error)
	grpc.ClientStream
}

type MyStreamService_RequestPointsServer

type MyStreamService_RequestPointsServer interface {
	Send(*Point) error
	grpc.ServerStream
}

type MyStreamService_StreamPointsClient

type MyStreamService_StreamPointsClient interface {
	Send(*Point) error
	CloseAndRecv() (*RouteSummary, error)
	grpc.ClientStream
}

type MyStreamService_StreamPointsServer

type MyStreamService_StreamPointsServer interface {
	SendAndClose(*RouteSummary) error
	Recv() (*Point, error)
	grpc.ServerStream
}

type Point

type Point struct {
	Latitude  int32 `protobuf:"varint,1,opt,name=latitude,proto3" json:"latitude,omitempty"`
	Longitude int32 `protobuf:"varint,2,opt,name=longitude,proto3" json:"longitude,omitempty"`
	// contains filtered or unexported fields
}

Points are represented as latitude-longitude pairs in the E7 representation (degrees multiplied by 10**7 and rounded to the nearest integer). Latitudes should be in the range +/- 90 degrees and longitude should be in the range +/- 180 degrees (inclusive).

func (*Point) Descriptor deprecated

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

Deprecated: Use Point.ProtoReflect.Descriptor instead.

func (*Point) GetLatitude

func (x *Point) GetLatitude() int32

func (*Point) GetLongitude

func (x *Point) GetLongitude() int32

func (*Point) ProtoMessage

func (*Point) ProtoMessage()

func (*Point) ProtoReflect

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

func (*Point) Reset

func (x *Point) Reset()

func (*Point) String

func (x *Point) String() string

type PointsRequest

type PointsRequest struct {
	Points []string `protobuf:"bytes,1,rep,name=points,proto3" json:"points,omitempty"`
	// contains filtered or unexported fields
}

func (*PointsRequest) Descriptor deprecated

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

Deprecated: Use PointsRequest.ProtoReflect.Descriptor instead.

func (*PointsRequest) GetPoints

func (x *PointsRequest) GetPoints() []string

func (*PointsRequest) ProtoMessage

func (*PointsRequest) ProtoMessage()

func (*PointsRequest) ProtoReflect

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

func (*PointsRequest) Reset

func (x *PointsRequest) Reset()

func (*PointsRequest) String

func (x *PointsRequest) String() string

type RouteSummary

type RouteSummary struct {

	// The number of points received.
	PointCount int32 `protobuf:"varint,1,opt,name=point_count,json=pointCount,proto3" json:"point_count,omitempty"`
	// The duration of the traversal in seconds.
	ElapsedTime int32 `protobuf:"varint,2,opt,name=elapsed_time,json=elapsedTime,proto3" json:"elapsed_time,omitempty"`
	// contains filtered or unexported fields
}

func (*RouteSummary) Descriptor deprecated

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

Deprecated: Use RouteSummary.ProtoReflect.Descriptor instead.

func (*RouteSummary) GetElapsedTime

func (x *RouteSummary) GetElapsedTime() int32

func (*RouteSummary) GetPointCount

func (x *RouteSummary) GetPointCount() int32

func (*RouteSummary) ProtoMessage

func (*RouteSummary) ProtoMessage()

func (*RouteSummary) ProtoReflect

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

func (*RouteSummary) Reset

func (x *RouteSummary) Reset()

func (*RouteSummary) String

func (x *RouteSummary) String() string

type UnimplementedFluffyCoreGreeterServerEndpointRegistration added in v1.0.8

type UnimplementedFluffyCoreGreeterServerEndpointRegistration struct {
}

func (UnimplementedFluffyCoreGreeterServerEndpointRegistration) RegisterFluffyCoreHandler added in v1.0.8

type UnimplementedFluffyCoreMyStreamServiceServerEndpointRegistration added in v1.0.8

type UnimplementedFluffyCoreMyStreamServiceServerEndpointRegistration struct {
}

func (UnimplementedFluffyCoreMyStreamServiceServerEndpointRegistration) RegisterFluffyCoreHandler added in v1.0.8

type UnimplementedGreeterServer

type UnimplementedGreeterServer struct {
}

UnimplementedGreeterServer must be embedded to have forward compatible implementations.

func (UnimplementedGreeterServer) SayHello

type UnimplementedMyStreamServiceServer

type UnimplementedMyStreamServiceServer struct {
}

UnimplementedMyStreamServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedMyStreamServiceServer) RequestPoints

func (UnimplementedMyStreamServiceServer) StreamPoints

type UnsafeGreeterServer

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

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

type UnsafeMyStreamServiceServer

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

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

Jump to

Keyboard shortcuts

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