server

package
v1.48.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_hello_proto protoreflect.FileDescriptor
View Source
var Hello_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Hello",
	HandlerType: (*HelloServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SayHello",
			Handler:    _Hello_SayHello_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "hello.proto",
}

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

Functions

func RegisterHelloServer

func RegisterHelloServer(s grpc.ServiceRegistrar, srv HelloServer)

func RegisterHelloServerWithGofr

func RegisterHelloServerWithGofr(app *gofr.App, srv HelloServerWithGofr)

RegisterHelloServerWithGofr registers the server

Types

type HelloClient

type HelloClient interface {
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
}

HelloClient is the client API for Hello 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 NewHelloClient

func NewHelloClient(cc grpc.ClientConnInterface) HelloClient

type HelloGoFrServer

type HelloGoFrServer struct {
	// contains filtered or unexported fields
}

func NewHelloGoFrServer

func NewHelloGoFrServer() *HelloGoFrServer

NewHelloGoFrServer creates a new instance of HelloGoFrServer

func (*HelloGoFrServer) SayHello

func (s *HelloGoFrServer) SayHello(ctx *gofr.Context) (any, error)

type HelloRequest

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

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 HelloRequestWrapper

type HelloRequestWrapper struct {
	*HelloRequest
	// contains filtered or unexported fields
}

Request Wrappers

func (*HelloRequestWrapper) Bind

func (h *HelloRequestWrapper) Bind(p interface{}) error

func (*HelloRequestWrapper) Context

func (h *HelloRequestWrapper) Context() context.Context

func (*HelloRequestWrapper) HostName

func (h *HelloRequestWrapper) HostName() string

func (*HelloRequestWrapper) Param

func (h *HelloRequestWrapper) Param(s string) string

func (*HelloRequestWrapper) Params

func (h *HelloRequestWrapper) Params(s string) []string

func (*HelloRequestWrapper) PathParam

func (h *HelloRequestWrapper) PathParam(s string) string

type HelloResponse

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

func (*HelloResponse) Descriptor deprecated

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

Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.

func (*HelloResponse) GetMessage

func (x *HelloResponse) GetMessage() 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 HelloServer

type HelloServer interface {
	SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
	// contains filtered or unexported methods
}

HelloServer is the server API for Hello service. All implementations must embed UnimplementedHelloServer for forward compatibility

type HelloServerWithGofr

type HelloServerWithGofr interface {
	SayHello(*gofr.Context) (any, error)
}

HelloServerWithGofr is the interface for the server implementation

type HelloServerWrapper

type HelloServerWrapper struct {
	HelloServer

	Container *container.Container
	// contains filtered or unexported fields
}

HelloServerWrapper wraps the server and handles request and response logic

func (HelloServerWrapper) Check

func (h HelloServerWrapper) Check(ctx *gofr.Context, req *healthpb.HealthCheckRequest) (*healthpb.HealthCheckResponse, error)

func (HelloServerWrapper) Resume

func (h HelloServerWrapper) Resume(ctx *gofr.Context)

func (*HelloServerWrapper) SayHello

Unary method handler for SayHello

func (HelloServerWrapper) SetServingStatus

func (h HelloServerWrapper) SetServingStatus(ctx *gofr.Context, service string, servingStatus healthpb.HealthCheckResponse_ServingStatus)

func (HelloServerWrapper) Shutdown

func (h HelloServerWrapper) Shutdown(ctx *gofr.Context)

func (HelloServerWrapper) Watch

func (h HelloServerWrapper) Watch(ctx *gofr.Context, in *healthpb.HealthCheckRequest, stream healthpb.Health_WatchServer) error

type UnimplementedHelloServer

type UnimplementedHelloServer struct {
}

UnimplementedHelloServer must be embedded to have forward compatible implementations.

func (UnimplementedHelloServer) SayHello

type UnsafeHelloServer

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

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

Jump to

Keyboard shortcuts

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