testpb

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestService_UnaryUnbound_FullMethodName    = "/grpcbridge.internal.bridgetest.testpb.TestService/UnaryUnbound"
	TestService_UnaryBound_FullMethodName      = "/grpcbridge.internal.bridgetest.testpb.TestService/UnaryBound"
	TestService_UnaryCombined_FullMethodName   = "/grpcbridge.internal.bridgetest.testpb.TestService/UnaryCombined"
	TestService_BadResponsePath_FullMethodName = "/grpcbridge.internal.bridgetest.testpb.TestService/BadResponsePath"
	TestService_Echo_FullMethodName            = "/grpcbridge.internal.bridgetest.testpb.TestService/Echo"
)

Variables

View Source
var (
	Digits_name = map[int32]string{
		0: "ZERO",

		1: "ONE",
		2: "TWO",
	}
	Digits_value = map[string]int32{
		"ZERO": 0,
		"NONE": 0,
		"ONE":  1,
		"TWO":  2,
	}
)

Enum value maps for Digits.

View Source
var (
	TestServiceFDs           *descriptorpb.FileDescriptorSet
	TestServiceFileResolver  *protoregistry.Files
	TestServiceTypesResolver *dynamicpb.Types
	TestServiceDesc          *bridgedesc.Target
)

TestServiceFDs is a set of the raw protobuf file descriptors for TestService.

View Source
var File_messages_proto protoreflect.FileDescriptor
View Source
var File_testsvc_proto protoreflect.FileDescriptor
View Source
var TestService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpcbridge.internal.bridgetest.testpb.TestService",
	HandlerType: (*TestServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "UnaryUnbound",
			Handler:    _TestService_UnaryUnbound_Handler,
		},
		{
			MethodName: "UnaryBound",
			Handler:    _TestService_UnaryBound_Handler,
		},
		{
			MethodName: "UnaryCombined",
			Handler:    _TestService_UnaryCombined_Handler,
		},
		{
			MethodName: "BadResponsePath",
			Handler:    _TestService_BadResponsePath_Handler,
		},
		{
			MethodName: "Echo",
			Handler:    _TestService_Echo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "testsvc.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 Combined

type Combined struct {
	Scalars    *Scalars    `protobuf:"bytes,1,opt,name=scalars,proto3" json:"scalars,omitempty"`
	NonScalars *NonScalars `protobuf:"bytes,2,opt,name=non_scalars,json=nonScalars,proto3" json:"non_scalars,omitempty"`
	// contains filtered or unexported fields
}

func (*Combined) Descriptor deprecated

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

Deprecated: Use Combined.ProtoReflect.Descriptor instead.

func (*Combined) GetNonScalars

func (x *Combined) GetNonScalars() *NonScalars

func (*Combined) GetScalars

func (x *Combined) GetScalars() *Scalars

func (*Combined) ProtoMessage

func (*Combined) ProtoMessage()

func (*Combined) ProtoReflect

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

func (*Combined) Reset

func (x *Combined) Reset()

func (*Combined) String

func (x *Combined) String() string

type Digits

type Digits int32
const (
	Digits_ZERO Digits = 0
	Digits_NONE Digits = 0
	Digits_ONE  Digits = 1
	Digits_TWO  Digits = 2
)

func (Digits) Descriptor

func (Digits) Descriptor() protoreflect.EnumDescriptor

func (Digits) Enum

func (x Digits) Enum() *Digits

func (Digits) EnumDescriptor deprecated

func (Digits) EnumDescriptor() ([]byte, []int)

Deprecated: Use Digits.Descriptor instead.

func (Digits) Number

func (x Digits) Number() protoreflect.EnumNumber

func (Digits) String

func (x Digits) String() string

func (Digits) Type

func (Digits) Type() protoreflect.EnumType

type NonScalars

type NonScalars struct {
	Str2StrMap   map[string]string        `` /* 179-byte string literal not displayed */
	Str2Int32Map map[string]int32         `` /* 186-byte string literal not displayed */
	Int2EmptyMap map[int32]*emptypb.Empty `` /* 186-byte string literal not displayed */
	StrList      []string                 `protobuf:"bytes,4,rep,name=str_list,json=strList,proto3" json:"str_list,omitempty"`
	MsgList      []*NonScalars_Child      `protobuf:"bytes,5,rep,name=msg_list,json=msgList,proto3" json:"msg_list,omitempty"`
	RootDigits   Digits                   `` /* 142-byte string literal not displayed */
	Duration     *durationpb.Duration     `protobuf:"bytes,7,opt,name=duration,proto3" json:"duration,omitempty"`
	Child        *NonScalars_Child        `protobuf:"bytes,8,opt,name=child,proto3" json:"child,omitempty"`
	// contains filtered or unexported fields
}

func (*NonScalars) Descriptor deprecated

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

Deprecated: Use NonScalars.ProtoReflect.Descriptor instead.

func (*NonScalars) GetChild

func (x *NonScalars) GetChild() *NonScalars_Child

func (*NonScalars) GetDuration

func (x *NonScalars) GetDuration() *durationpb.Duration

func (*NonScalars) GetInt2EmptyMap

func (x *NonScalars) GetInt2EmptyMap() map[int32]*emptypb.Empty

func (*NonScalars) GetMsgList

func (x *NonScalars) GetMsgList() []*NonScalars_Child

func (*NonScalars) GetRootDigits

func (x *NonScalars) GetRootDigits() Digits

func (*NonScalars) GetStr2Int32Map

func (x *NonScalars) GetStr2Int32Map() map[string]int32

func (*NonScalars) GetStr2StrMap

func (x *NonScalars) GetStr2StrMap() map[string]string

func (*NonScalars) GetStrList

func (x *NonScalars) GetStrList() []string

func (*NonScalars) ProtoMessage

func (*NonScalars) ProtoMessage()

func (*NonScalars) ProtoReflect

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

func (*NonScalars) Reset

func (x *NonScalars) Reset()

func (*NonScalars) String

func (x *NonScalars) String() string

type NonScalars_Child

type NonScalars_Child struct {

	// Types that are assignable to Nested:
	//
	//	*NonScalars_Child_Digits
	//	*NonScalars_Child_GrandChild_
	Nested       isNonScalars_Child_Nested `protobuf_oneof:"nested"`
	ExtraScalars *Scalars                  `protobuf:"bytes,3,opt,name=extra_scalars,json=extraScalars,proto3" json:"extra_scalars,omitempty"`
	// contains filtered or unexported fields
}

func (*NonScalars_Child) Descriptor deprecated

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

Deprecated: Use NonScalars_Child.ProtoReflect.Descriptor instead.

func (*NonScalars_Child) GetDigits

func (x *NonScalars_Child) GetDigits() Digits

func (*NonScalars_Child) GetExtraScalars

func (x *NonScalars_Child) GetExtraScalars() *Scalars

func (*NonScalars_Child) GetGrandChild

func (x *NonScalars_Child) GetGrandChild() *NonScalars_Child_GrandChild

func (*NonScalars_Child) GetNested

func (m *NonScalars_Child) GetNested() isNonScalars_Child_Nested

func (*NonScalars_Child) ProtoMessage

func (*NonScalars_Child) ProtoMessage()

func (*NonScalars_Child) ProtoReflect

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

func (*NonScalars_Child) Reset

func (x *NonScalars_Child) Reset()

func (*NonScalars_Child) String

func (x *NonScalars_Child) String() string

type NonScalars_Child_Digits

type NonScalars_Child_Digits struct {
	Digits Digits `protobuf:"varint,1,opt,name=digits,proto3,enum=grpcbridge.internal.bridgetest.testpb.Digits,oneof"`
}

type NonScalars_Child_GrandChild

type NonScalars_Child_GrandChild struct {
	BytesValue []byte `protobuf:"bytes,1,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"`
	// contains filtered or unexported fields
}

func (*NonScalars_Child_GrandChild) Descriptor deprecated

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

Deprecated: Use NonScalars_Child_GrandChild.ProtoReflect.Descriptor instead.

func (*NonScalars_Child_GrandChild) GetBytesValue

func (x *NonScalars_Child_GrandChild) GetBytesValue() []byte

func (*NonScalars_Child_GrandChild) ProtoMessage

func (*NonScalars_Child_GrandChild) ProtoMessage()

func (*NonScalars_Child_GrandChild) ProtoReflect

func (*NonScalars_Child_GrandChild) Reset

func (x *NonScalars_Child_GrandChild) Reset()

func (*NonScalars_Child_GrandChild) String

func (x *NonScalars_Child_GrandChild) String() string

type NonScalars_Child_GrandChild_

type NonScalars_Child_GrandChild_ struct {
	GrandChild *NonScalars_Child_GrandChild `protobuf:"bytes,2,opt,name=grand_child,json=grandChild,proto3,oneof"`
}

type PreparedResponse

type PreparedResponse[T proto.Message] struct {
	Response T
	Error    error
}

func PrepareResponse

func PrepareResponse[T proto.Message](response T, err error) *PreparedResponse[T]

type Scalars

type Scalars struct {
	BoolValue     bool    `protobuf:"varint,1,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"`
	Int32Value    int32   `protobuf:"varint,2,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"`
	Int64Value    int64   `protobuf:"varint,3,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"`
	Uint32Value   uint32  `protobuf:"varint,4,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"`
	Uint64Value   uint64  `protobuf:"varint,5,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"`
	Sint32Value   int32   `protobuf:"zigzag32,6,opt,name=sint32_value,json=sint32Value,proto3" json:"sint32_value,omitempty"`
	Sint64Value   int64   `protobuf:"zigzag64,7,opt,name=sint64_value,json=sint64Value,proto3" json:"sint64_value,omitempty"`
	Fixed32Value  uint32  `protobuf:"fixed32,8,opt,name=fixed32_value,json=fixed32Value,proto3" json:"fixed32_value,omitempty"`
	Fixed64Value  uint64  `protobuf:"fixed64,9,opt,name=fixed64_value,json=fixed64Value,proto3" json:"fixed64_value,omitempty"`
	Sfixed32Value int32   `protobuf:"fixed32,10,opt,name=sfixed32_value,json=sfixed32Value,proto3" json:"sfixed32_value,omitempty"`
	Sfixed64Value int64   `protobuf:"fixed64,11,opt,name=sfixed64_value,json=sfixed64Value,proto3" json:"sfixed64_value,omitempty"`
	FloatValue    float32 `protobuf:"fixed32,12,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"`
	DoubleValue   float64 `protobuf:"fixed64,13,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"`
	StringValue   string  `protobuf:"bytes,14,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"`
	BytesValue    []byte  `protobuf:"bytes,15,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"`
	// contains filtered or unexported fields
}

func (*Scalars) Descriptor deprecated

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

Deprecated: Use Scalars.ProtoReflect.Descriptor instead.

func (*Scalars) GetBoolValue

func (x *Scalars) GetBoolValue() bool

func (*Scalars) GetBytesValue

func (x *Scalars) GetBytesValue() []byte

func (*Scalars) GetDoubleValue

func (x *Scalars) GetDoubleValue() float64

func (*Scalars) GetFixed32Value

func (x *Scalars) GetFixed32Value() uint32

func (*Scalars) GetFixed64Value

func (x *Scalars) GetFixed64Value() uint64

func (*Scalars) GetFloatValue

func (x *Scalars) GetFloatValue() float32

func (*Scalars) GetInt32Value

func (x *Scalars) GetInt32Value() int32

func (*Scalars) GetInt64Value

func (x *Scalars) GetInt64Value() int64

func (*Scalars) GetSfixed32Value

func (x *Scalars) GetSfixed32Value() int32

func (*Scalars) GetSfixed64Value

func (x *Scalars) GetSfixed64Value() int64

func (*Scalars) GetSint32Value

func (x *Scalars) GetSint32Value() int32

func (*Scalars) GetSint64Value

func (x *Scalars) GetSint64Value() int64

func (*Scalars) GetStringValue

func (x *Scalars) GetStringValue() string

func (*Scalars) GetUint32Value

func (x *Scalars) GetUint32Value() uint32

func (*Scalars) GetUint64Value

func (x *Scalars) GetUint64Value() uint64

func (*Scalars) ProtoMessage

func (*Scalars) ProtoMessage()

func (*Scalars) ProtoReflect

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

func (*Scalars) Reset

func (x *Scalars) Reset()

func (*Scalars) String

func (x *Scalars) String() string

type TestService

type TestService struct {
	UnimplementedTestServiceServer
	UnaryBoundRequest  *Scalars
	UnaryBoundResponse *PreparedResponse[*Combined]
}

TestService implements the test gRPC service with handlers which simply record the requests and return predetermined responses.

func (*TestService) BadResponsePath

func (s *TestService) BadResponsePath(context.Context, *Scalars) (*Combined, error)

func (*TestService) Echo

func (s *TestService) Echo(ctx context.Context, req *Combined) (*Combined, error)

func (*TestService) UnaryBound

func (s *TestService) UnaryBound(ctx context.Context, req *Scalars) (*Combined, error)

type TestServiceClient

type TestServiceClient interface {
	UnaryUnbound(ctx context.Context, in *Scalars, opts ...grpc.CallOption) (*Scalars, error)
	UnaryBound(ctx context.Context, in *Scalars, opts ...grpc.CallOption) (*Combined, error)
	UnaryCombined(ctx context.Context, in *Combined, opts ...grpc.CallOption) (*Combined, error)
	BadResponsePath(ctx context.Context, in *Scalars, opts ...grpc.CallOption) (*Combined, error)
	Echo(ctx context.Context, in *Combined, opts ...grpc.CallOption) (*Combined, 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 {
	UnaryUnbound(context.Context, *Scalars) (*Scalars, error)
	UnaryBound(context.Context, *Scalars) (*Combined, error)
	UnaryCombined(context.Context, *Combined) (*Combined, error)
	BadResponsePath(context.Context, *Scalars) (*Combined, error)
	Echo(context.Context, *Combined) (*Combined, 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) BadResponsePath

func (UnimplementedTestServiceServer) Echo

func (UnimplementedTestServiceServer) UnaryBound

func (UnimplementedTestServiceServer) UnaryCombined

func (UnimplementedTestServiceServer) UnaryUnbound

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.

type WellKnown

type WellKnown struct {
	NullValue structpb.NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue" json:"null_value,omitempty"`
	// contains filtered or unexported fields
}

func (*WellKnown) Descriptor deprecated

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

Deprecated: Use WellKnown.ProtoReflect.Descriptor instead.

func (*WellKnown) GetNullValue

func (x *WellKnown) GetNullValue() structpb.NullValue

func (*WellKnown) ProtoMessage

func (*WellKnown) ProtoMessage()

func (*WellKnown) ProtoReflect

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

func (*WellKnown) Reset

func (x *WellKnown) Reset()

func (*WellKnown) String

func (x *WellKnown) String() string

Directories

Path Synopsis
google
api

Jump to

Keyboard shortcuts

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