Help us shape the future of Go! Take the 2026 Go Developer Survey

grpc

package
v1.20.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestService_Get_FullMethodName = "/grpc.TestService/Get"
)

Variables

View Source
var TestService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.TestService",
	HandlerType: (*TestServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _TestService_Get_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "test.proto",
}

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

Functions

func RegisterTestServiceServer

func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer)

Types

type Application

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

func NewApplication

func NewApplication(config config.Config) *Application

func (*Application) Client

func (r *Application) Client(ctx context.Context, name string) (*grpc.ClientConn, error)

DEPRECATED: Use Connect instead, will be removed in v1.18.

func (*Application) ClientCredentials

func (r *Application) ClientCredentials(groups map[string]credentials.TransportCredentials)

func (*Application) ClientStatsHandlerGroups

func (r *Application) ClientStatsHandlerGroups(groups map[string][]stats.Handler)

func (*Application) Connect

func (r *Application) Connect(client string) (*grpc.ClientConn, error)

func (*Application) Listen

func (r *Application) Listen(l net.Listener) error

func (*Application) Run

func (r *Application) Run(host ...string) error

func (*Application) Server

func (r *Application) Server() *grpc.Server

func (*Application) ServerCredentials

func (r *Application) ServerCredentials(creds credentials.TransportCredentials)

func (*Application) ServerOptions

func (r *Application) ServerOptions(options []grpc.ServerOption)

func (*Application) ServerStatsHandlers

func (r *Application) ServerStatsHandlers(handlers []stats.Handler)

func (*Application) Shutdown

func (r *Application) Shutdown(force ...bool) error

func (*Application) UnaryClientInterceptorGroups

func (r *Application) UnaryClientInterceptorGroups(groups map[string][]grpc.UnaryClientInterceptor)

func (*Application) UnaryServerInterceptors

func (r *Application) UnaryServerInterceptors(unaryServerInterceptors []grpc.UnaryServerInterceptor)

type GrpcRunner

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

func NewGrpcRunner

func NewGrpcRunner(config config.Config, grpc grpc.Grpc) *GrpcRunner

func (*GrpcRunner) Run

func (r *GrpcRunner) Run() error

func (*GrpcRunner) ShouldRun

func (r *GrpcRunner) ShouldRun() bool

func (*GrpcRunner) Shutdown

func (r *GrpcRunner) Shutdown() error

func (*GrpcRunner) Signature

func (r *GrpcRunner) Signature() string

type ServiceProvider

type ServiceProvider struct {
}

func (*ServiceProvider) Boot

func (r *ServiceProvider) Boot(app foundation.Application)

func (*ServiceProvider) Register

func (r *ServiceProvider) Register(app foundation.Application)

func (*ServiceProvider) Relationship

func (r *ServiceProvider) Relationship() binding.Relationship

func (*ServiceProvider) Runners

type TestRequest

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

func (*TestRequest) Descriptor deprecated

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

Deprecated: Use TestRequest.ProtoReflect.Descriptor instead.

func (*TestRequest) GetName

func (x *TestRequest) GetName() string

func (*TestRequest) ProtoMessage

func (*TestRequest) ProtoMessage()

func (*TestRequest) ProtoReflect

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

func (*TestRequest) Reset

func (x *TestRequest) Reset()

func (*TestRequest) String

func (x *TestRequest) String() string

type TestResponse

type TestResponse struct {
	Code    int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*TestResponse) Descriptor deprecated

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

Deprecated: Use TestResponse.ProtoReflect.Descriptor instead.

func (*TestResponse) GetCode

func (x *TestResponse) GetCode() int32

func (*TestResponse) GetMessage

func (x *TestResponse) GetMessage() string

func (*TestResponse) ProtoMessage

func (*TestResponse) ProtoMessage()

func (*TestResponse) ProtoReflect

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

func (*TestResponse) Reset

func (x *TestResponse) Reset()

func (*TestResponse) String

func (x *TestResponse) String() string

type TestServiceClient

type TestServiceClient interface {
	Get(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*TestResponse, error)
}

TestServiceClient is the client API for TestService 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 TestServiceServer

type TestServiceServer interface {
	Get(context.Context, *TestRequest) (*TestResponse, error)
	// contains filtered or unexported methods
}

TestServiceServer is the server API for TestService service. All implementations must embed UnimplementedTestServiceServer for forward compatibility

type UnimplementedTestServiceServer

type UnimplementedTestServiceServer struct {
}

UnimplementedTestServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTestServiceServer) Get

type UnsafeTestServiceServer

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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