grpccompat

package module
v0.0.0-...-a5d487a Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 13 Imported by: 0

README

package grpccompat

import "storj.io/drpc/internal/grpccompat"

package grpccompat holds compatability tests for grpc.

Documentation

Overview

Package grpccompat holds compatibility tests for grpc.

Index

Constants

This section is empty.

Variables

View Source
var File_service_proto protoreflect.FileDescriptor
View Source
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "service.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Method1",
			Handler:    _Service_Method1_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Method2",
			Handler:       _Service_Method2_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "Method3",
			Handler:       _Service_Method3_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Method4",
			Handler:       _Service_Method4_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "service.proto",
}

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

Functions

func DRPCRegisterService

func DRPCRegisterService(mux drpc.Mux, impl DRPCServiceServer) error

func RegisterServiceServer

func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)

Types

type DRPCServiceClient

type DRPCServiceClient interface {
	DRPCConn() drpc.Conn

	Method1(ctx context.Context, in *In) (*Out, error)
	Method2(ctx context.Context) (DRPCService_Method2Client, error)
	Method3(ctx context.Context, in *In) (DRPCService_Method3Client, error)
	Method4(ctx context.Context) (DRPCService_Method4Client, error)
}

func NewDRPCServiceClient

func NewDRPCServiceClient(cc drpc.Conn) DRPCServiceClient

type DRPCServiceDescription

type DRPCServiceDescription struct{}

func (DRPCServiceDescription) Method

func (DRPCServiceDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool)

func (DRPCServiceDescription) NumMethods

func (DRPCServiceDescription) NumMethods() int

type DRPCServiceServer

type DRPCServiceServer interface {
	Method1(context.Context, *In) (*Out, error)
	Method2(DRPCService_Method2Stream) error
	Method3(*In, DRPCService_Method3Stream) error
	Method4(DRPCService_Method4Stream) error
}

type DRPCServiceUnimplementedServer

type DRPCServiceUnimplementedServer struct{}

func (*DRPCServiceUnimplementedServer) Method1

func (*DRPCServiceUnimplementedServer) Method2

func (*DRPCServiceUnimplementedServer) Method3

func (*DRPCServiceUnimplementedServer) Method4

type DRPCService_Method1Stream

type DRPCService_Method1Stream interface {
	drpc.Stream
	SendAndClose(*Out) error
}

type DRPCService_Method2Client

type DRPCService_Method2Client interface {
	drpc.Stream
	Send(*In) error
	CloseAndRecv() (*Out, error)
}

type DRPCService_Method2Stream

type DRPCService_Method2Stream interface {
	drpc.Stream
	SendAndClose(*Out) error
	Recv() (*In, error)
}

type DRPCService_Method3Client

type DRPCService_Method3Client interface {
	drpc.Stream
	Recv() (*Out, error)
}

type DRPCService_Method3Stream

type DRPCService_Method3Stream interface {
	drpc.Stream
	Send(*Out) error
}

type DRPCService_Method4Client

type DRPCService_Method4Client interface {
	drpc.Stream
	Send(*In) error
	Recv() (*Out, error)
}

type DRPCService_Method4Stream

type DRPCService_Method4Stream interface {
	drpc.Stream
	Send(*Out) error
	Recv() (*In, error)
}

type In

type In struct {
	In  int64  `protobuf:"varint,1,opt,name=in,proto3" json:"in,omitempty"`
	Buf []byte `protobuf:"bytes,2,opt,name=buf,proto3" json:"buf,omitempty"`
	Opt *int64 `protobuf:"varint,3,opt,name=opt,proto3,oneof" json:"opt,omitempty"`
	// contains filtered or unexported fields
}

func (*In) Descriptor deprecated

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

Deprecated: Use In.ProtoReflect.Descriptor instead.

func (*In) GetBuf

func (x *In) GetBuf() []byte

func (*In) GetIn

func (x *In) GetIn() int64

func (*In) GetOpt

func (x *In) GetOpt() int64

func (*In) ProtoMessage

func (*In) ProtoMessage()

func (*In) ProtoReflect

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

func (*In) Reset

func (x *In) Reset()

func (*In) String

func (x *In) String() string

type Out

type Out struct {
	Out int64  `protobuf:"varint,1,opt,name=out,proto3" json:"out,omitempty"`
	Buf []byte `protobuf:"bytes,2,opt,name=buf,proto3" json:"buf,omitempty"`
	Opt *int64 `protobuf:"varint,3,opt,name=opt,proto3,oneof" json:"opt,omitempty"`
	// contains filtered or unexported fields
}

func (*Out) Descriptor deprecated

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

Deprecated: Use Out.ProtoReflect.Descriptor instead.

func (*Out) GetBuf

func (x *Out) GetBuf() []byte

func (*Out) GetOpt

func (x *Out) GetOpt() int64

func (*Out) GetOut

func (x *Out) GetOut() int64

func (*Out) ProtoMessage

func (*Out) ProtoMessage()

func (*Out) ProtoReflect

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

func (*Out) Reset

func (x *Out) Reset()

func (*Out) String

func (x *Out) String() string

type ServiceClient

type ServiceClient interface {
	Method1(ctx context.Context, in *In, opts ...grpc.CallOption) (*Out, error)
	Method2(ctx context.Context, opts ...grpc.CallOption) (Service_Method2Client, error)
	Method3(ctx context.Context, in *In, opts ...grpc.CallOption) (Service_Method3Client, error)
	Method4(ctx context.Context, opts ...grpc.CallOption) (Service_Method4Client, error)
}

ServiceClient is the client API for Service 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 NewServiceClient

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceServer

type ServiceServer interface {
	Method1(context.Context, *In) (*Out, error)
	Method2(Service_Method2Server) error
	Method3(*In, Service_Method3Server) error
	Method4(Service_Method4Server) error
	// contains filtered or unexported methods
}

ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility

type Service_Method2Client

type Service_Method2Client interface {
	Send(*In) error
	CloseAndRecv() (*Out, error)
	grpc.ClientStream
}

type Service_Method2Server

type Service_Method2Server interface {
	SendAndClose(*Out) error
	Recv() (*In, error)
	grpc.ServerStream
}

type Service_Method3Client

type Service_Method3Client interface {
	Recv() (*Out, error)
	grpc.ClientStream
}

type Service_Method3Server

type Service_Method3Server interface {
	Send(*Out) error
	grpc.ServerStream
}

type Service_Method4Client

type Service_Method4Client interface {
	Send(*In) error
	Recv() (*Out, error)
	grpc.ClientStream
}

type Service_Method4Server

type Service_Method4Server interface {
	Send(*Out) error
	Recv() (*In, error)
	grpc.ServerStream
}

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedServiceServer) Method1

func (UnimplementedServiceServer) Method2

func (UnimplementedServiceServer) Method3

func (UnimplementedServiceServer) Method4

type UnsafeServiceServer

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

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

Jump to

Keyboard shortcuts

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