helloworld

package
v1.4.8-fix-dependencie... Latest Latest
Warning

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

Go to latest
Published: Aug 30, 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

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

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. This client ignores the HTTP middlewares.

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. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

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. This client ignores the HTTP middlewares.

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. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

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.

The greeting service definition.

func NewGreeterClient

func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient

type GreeterFluffyCoreServer

GreeterFluffyCoreServer defines the grpc server truct

func (*GreeterFluffyCoreServer) RegisterFluffyCoreGRPCService

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

RegisterFluffyCoreGRPCService the server with grpc

func (*GreeterFluffyCoreServer) SayHello

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.

The greeting service definition.

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

type IFluffyCoreGreeterServer interface {
	GreeterServer
}

IFluffyCoreGreeterServer defines the grpc server

type IFluffyCoreMyStreamServiceServer

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) (grpc.ServerStreamingClient[Point], 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) (grpc.ClientStreamingClient[Point, RouteSummary], 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

MyStreamServiceFluffyCoreServer defines the grpc server truct

func (*MyStreamServiceFluffyCoreServer) RegisterFluffyCoreGRPCService

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

RegisterFluffyCoreGRPCService the server with grpc

func (*MyStreamServiceFluffyCoreServer) RequestPoints

RequestPoints...

func (*MyStreamServiceFluffyCoreServer) StreamPoints

StreamPoints...

type MyStreamServiceServer

type MyStreamServiceServer interface {
	// RequestPoints
	// Request: Unary
	// Response: Streaming
	RequestPoints(*PointsRequest, grpc.ServerStreamingServer[Point]) error
	// Accepts a stream of Points on a route being traversed, returning a
	// RouteSummary when traversal is completed.
	StreamPoints(grpc.ClientStreamingServer[Point, RouteSummary]) 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 = grpc.ServerStreamingClient[Point]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type MyStreamService_RequestPointsServer

type MyStreamService_RequestPointsServer = grpc.ServerStreamingServer[Point]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type MyStreamService_StreamPointsClient

type MyStreamService_StreamPointsClient = grpc.ClientStreamingClient[Point, RouteSummary]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type MyStreamService_StreamPointsServer

type MyStreamService_StreamPointsServer = grpc.ClientStreamingServer[Point, RouteSummary]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

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

type UnimplementedFluffyCoreGreeterServerEndpointRegistration struct {
}

func (UnimplementedFluffyCoreGreeterServerEndpointRegistration) RegisterFluffyCoreHandler

type UnimplementedFluffyCoreMyStreamServiceServerEndpointRegistration

type UnimplementedFluffyCoreMyStreamServiceServerEndpointRegistration struct {
}

func (UnimplementedFluffyCoreMyStreamServiceServerEndpointRegistration) RegisterFluffyCoreHandler

type UnimplementedGreeterServer

type UnimplementedGreeterServer struct{}

UnimplementedGreeterServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedGreeterServer) SayHello

type UnimplementedMyStreamServiceServer

type UnimplementedMyStreamServiceServer struct{}

UnimplementedMyStreamServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

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