Documentation ¶
Overview ¶
Package helloworld is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func AddGreeterServer[T IGreeterServer](cb fluffy_dozm_di.ContainerBuilder, ctor any)
- func AddGreeterServerWithExternalRegistration[T IGreeterServer](cb fluffy_dozm_di.ContainerBuilder, ctor any, ...)
- func AddMyStreamServiceServer[T IMyStreamServiceServer](cb fluffy_dozm_di.ContainerBuilder, ctor any)
- func AddMyStreamServiceServerWithExternalRegistration[T IMyStreamServiceServer](cb fluffy_dozm_di.ContainerBuilder, ctor any, ...)
- func RegisterGreeterHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGreeterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreeterClient) error
- func RegisterGreeterHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGreeterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreeterServer) error
- func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer)
- func RegisterMyStreamServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMyStreamServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MyStreamServiceClient) error
- func RegisterMyStreamServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMyStreamServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MyStreamServiceServer) error
- func RegisterMyStreamServiceServer(s grpc.ServiceRegistrar, srv MyStreamServiceServer)
- type GreeterClient
- type GreeterFluffyCoreServer
- type GreeterServer
- type HelloReply
- type HelloRequest
- type IGreeterServer
- type IMyStreamServiceServer
- type MyStreamServiceClient
- type MyStreamServiceFluffyCoreServer
- func (srv *MyStreamServiceFluffyCoreServer) Register(s *grpc.Server)
- func (s *MyStreamServiceFluffyCoreServer) RequestPoints(request *PointsRequest, stream MyStreamService_RequestPointsServer) error
- func (s *MyStreamServiceFluffyCoreServer) StreamPoints(stream MyStreamService_StreamPointsServer) error
- type MyStreamServiceServer
- type MyStreamService_RequestPointsClient
- type MyStreamService_RequestPointsServer
- type MyStreamService_StreamPointsClient
- type MyStreamService_StreamPointsServer
- type Point
- type PointsRequest
- type RouteSummary
- func (*RouteSummary) Descriptor() ([]byte, []int)deprecated
- func (x *RouteSummary) GetElapsedTime() int32
- func (x *RouteSummary) GetPointCount() int32
- func (*RouteSummary) ProtoMessage()
- func (x *RouteSummary) ProtoReflect() protoreflect.Message
- func (x *RouteSummary) Reset()
- func (x *RouteSummary) String() string
- type UnimplementedGreeterServer
- type UnimplementedGreeterServerEndpointRegistration
- type UnimplementedMyStreamServiceServer
- type UnimplementedMyStreamServiceServerEndpointRegistration
- type UnsafeGreeterServer
- type UnsafeMyStreamServiceServer
Constants ¶
const ( MyStreamService_RequestPoints_FullMethodName = "/helloworld.MyStreamService/RequestPoints" MyStreamService_StreamPoints_FullMethodName = "/helloworld.MyStreamService/StreamPoints" )
const (
Greeter_SayHello_FullMethodName = "/helloworld.Greeter/SayHello"
)
Variables ¶
var File_proto_helloworld_helloworld_proto protoreflect.FileDescriptor
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)
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[T IGreeterServer](cb fluffy_dozm_di.ContainerBuilder, ctor any)
AddGreeterServer adds the fluffycore aware grpc server
func AddGreeterServerWithExternalRegistration ¶ added in v1.0.4
func AddGreeterServerWithExternalRegistration[T IGreeterServer](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[T IMyStreamServiceServer](cb fluffy_dozm_di.ContainerBuilder, ctor any)
AddMyStreamServiceServer adds the fluffycore aware grpc server
func AddMyStreamServiceServerWithExternalRegistration ¶ added in v1.0.4
func AddMyStreamServiceServerWithExternalRegistration[T IMyStreamServiceServer](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
type GreeterFluffyCoreServer struct { UnimplementedGreeterServer UnimplementedGreeterServerEndpointRegistration }
GreeterFluffyCoreServer defines the grpc server truct
func (*GreeterFluffyCoreServer) Register ¶ added in v1.0.4
func (srv *GreeterFluffyCoreServer) Register(s *grpc.Server)
Register 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 IGreeterServer ¶
type IGreeterServer interface { GreeterServer }
IGreeterServer defines the grpc server
type IMyStreamServiceServer ¶
type IMyStreamServiceServer interface { MyStreamServiceServer }
IMyStreamServiceServer 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.
func NewMyStreamServiceClient ¶
func NewMyStreamServiceClient(cc grpc.ClientConnInterface) MyStreamServiceClient
type MyStreamServiceFluffyCoreServer ¶ added in v1.0.4
type MyStreamServiceFluffyCoreServer struct { UnimplementedMyStreamServiceServer UnimplementedMyStreamServiceServerEndpointRegistration }
MyStreamServiceFluffyCoreServer defines the grpc server truct
func (*MyStreamServiceFluffyCoreServer) Register ¶ added in v1.0.4
func (srv *MyStreamServiceFluffyCoreServer) Register(s *grpc.Server)
Register the server with grpc
func (*MyStreamServiceFluffyCoreServer) RequestPoints ¶ added in v1.0.4
func (s *MyStreamServiceFluffyCoreServer) RequestPoints(request *PointsRequest, stream MyStreamService_RequestPointsServer) error
RequestPoints...
func (*MyStreamServiceFluffyCoreServer) StreamPoints ¶ added in v1.0.4
func (s *MyStreamServiceFluffyCoreServer) StreamPoints(stream MyStreamService_StreamPointsServer) error
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) GetLatitude ¶
func (*Point) GetLongitude ¶
func (*Point) ProtoMessage ¶
func (*Point) ProtoMessage()
func (*Point) ProtoReflect ¶
func (x *Point) ProtoReflect() protoreflect.Message
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 UnimplementedGreeterServer ¶
type UnimplementedGreeterServer struct { }
UnimplementedGreeterServer must be embedded to have forward compatible implementations.
func (UnimplementedGreeterServer) SayHello ¶
func (UnimplementedGreeterServer) SayHello(context.Context, *HelloRequest) (*HelloReply, error)
type UnimplementedGreeterServerEndpointRegistration ¶
type UnimplementedGreeterServerEndpointRegistration struct { }
func (UnimplementedGreeterServerEndpointRegistration) RegisterHandler ¶
func (UnimplementedGreeterServerEndpointRegistration) RegisterHandler(gwmux *runtime.ServeMux, conn *grpc.ClientConn)
type UnimplementedMyStreamServiceServer ¶
type UnimplementedMyStreamServiceServer struct { }
UnimplementedMyStreamServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedMyStreamServiceServer) RequestPoints ¶
func (UnimplementedMyStreamServiceServer) RequestPoints(*PointsRequest, MyStreamService_RequestPointsServer) error
func (UnimplementedMyStreamServiceServer) StreamPoints ¶
func (UnimplementedMyStreamServiceServer) StreamPoints(MyStreamService_StreamPointsServer) error
type UnimplementedMyStreamServiceServerEndpointRegistration ¶
type UnimplementedMyStreamServiceServerEndpointRegistration struct { }
func (UnimplementedMyStreamServiceServerEndpointRegistration) RegisterHandler ¶
func (UnimplementedMyStreamServiceServerEndpointRegistration) RegisterHandler(gwmux *runtime.ServeMux, conn *grpc.ClientConn)
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.