testservice

package
v0.0.0-...-dcb242a Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ItemKind_name = map[int32]string{
		0: "ITEM_KIND_UNSPECIFIED",
		1: "WIDGET",
		2: "GADGET",
	}
	ItemKind_value = map[string]int32{
		"ITEM_KIND_UNSPECIFIED": 0,
		"WIDGET":                1,
		"GADGET":                2,
	}
)

Enum value maps for ItemKind.

View Source
var Test_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ericchiang.protorest.internal.testservice.Test",
	HandlerType: (*TestServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetItem",
			Handler:    _Test_GetItem_Handler,
		},
		{
			MethodName: "CreateItem",
			Handler:    _Test_CreateItem_Handler,
		},
		{
			MethodName: "ListItems",
			Handler:    _Test_ListItems_Handler,
		},
		{
			MethodName: "TestResponseBody",
			Handler:    _Test_TestResponseBody_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "test.proto",
}

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

Functions

func RegisterTestServer

func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer)

Types

type CreateItemRequest

type CreateItemRequest struct {
	Item *Item `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateItemRequest) Descriptor deprecated

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

Deprecated: Use CreateItemRequest.ProtoReflect.Descriptor instead.

func (*CreateItemRequest) GetItem

func (x *CreateItemRequest) GetItem() *Item

func (*CreateItemRequest) ProtoMessage

func (*CreateItemRequest) ProtoMessage()

func (*CreateItemRequest) ProtoReflect

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

func (*CreateItemRequest) Reset

func (x *CreateItemRequest) Reset()

func (*CreateItemRequest) String

func (x *CreateItemRequest) String() string

type Filter

type Filter struct {
	Id   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Kind ItemKind `protobuf:"varint,2,opt,name=kind,proto3,enum=ericchiang.protorest.internal.testservice.ItemKind" json:"kind,omitempty"`
	// contains filtered or unexported fields
}

func (*Filter) Descriptor deprecated

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

Deprecated: Use Filter.ProtoReflect.Descriptor instead.

func (*Filter) GetId

func (x *Filter) GetId() int64

func (*Filter) GetKind

func (x *Filter) GetKind() ItemKind

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) ProtoReflect

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

func (*Filter) Reset

func (x *Filter) Reset()

func (*Filter) String

func (x *Filter) String() string

type GetItemRequest

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

func (*GetItemRequest) Descriptor deprecated

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

Deprecated: Use GetItemRequest.ProtoReflect.Descriptor instead.

func (*GetItemRequest) GetFilter

func (x *GetItemRequest) GetFilter() *Filter

func (*GetItemRequest) GetName

func (x *GetItemRequest) GetName() string

func (*GetItemRequest) ProtoMessage

func (*GetItemRequest) ProtoMessage()

func (*GetItemRequest) ProtoReflect

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

func (*GetItemRequest) Reset

func (x *GetItemRequest) Reset()

func (*GetItemRequest) String

func (x *GetItemRequest) String() string

type Item

type Item struct {
	Name string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Id   int64    `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
	Kind ItemKind `protobuf:"varint,3,opt,name=kind,proto3,enum=ericchiang.protorest.internal.testservice.ItemKind" json:"kind,omitempty"`
	// contains filtered or unexported fields
}

func (*Item) Descriptor deprecated

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

Deprecated: Use Item.ProtoReflect.Descriptor instead.

func (*Item) GetId

func (x *Item) GetId() int64

func (*Item) GetKind

func (x *Item) GetKind() ItemKind

func (*Item) GetName

func (x *Item) GetName() string

func (*Item) ProtoMessage

func (*Item) ProtoMessage()

func (*Item) ProtoReflect

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

func (*Item) Reset

func (x *Item) Reset()

func (*Item) String

func (x *Item) String() string

type ItemKind

type ItemKind int32
const (
	ItemKind_ITEM_KIND_UNSPECIFIED ItemKind = 0
	ItemKind_WIDGET                ItemKind = 1
	ItemKind_GADGET                ItemKind = 2
)

func (ItemKind) Descriptor

func (ItemKind) Descriptor() protoreflect.EnumDescriptor

func (ItemKind) Enum

func (x ItemKind) Enum() *ItemKind

func (ItemKind) EnumDescriptor deprecated

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

Deprecated: Use ItemKind.Descriptor instead.

func (ItemKind) Number

func (x ItemKind) Number() protoreflect.EnumNumber

func (ItemKind) String

func (x ItemKind) String() string

func (ItemKind) Type

type ListItemsResponse

type ListItemsResponse struct {
	Items []*Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*ListItemsResponse) Descriptor deprecated

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

Deprecated: Use ListItemsResponse.ProtoReflect.Descriptor instead.

func (*ListItemsResponse) GetItems

func (x *ListItemsResponse) GetItems() []*Item

func (*ListItemsResponse) ProtoMessage

func (*ListItemsResponse) ProtoMessage()

func (*ListItemsResponse) ProtoReflect

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

func (*ListItemsResponse) Reset

func (x *ListItemsResponse) Reset()

func (*ListItemsResponse) String

func (x *ListItemsResponse) String() string

type TestClient

type TestClient interface {
	GetItem(ctx context.Context, in *GetItemRequest, opts ...grpc.CallOption) (*Item, error)
	CreateItem(ctx context.Context, in *CreateItemRequest, opts ...grpc.CallOption) (*Item, error)
	ListItems(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListItemsResponse, error)
	TestResponseBody(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TestResponseBodyResponse, error)
}

TestClient is the client API for Test 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 NewTestClient

func NewTestClient(cc grpc.ClientConnInterface) TestClient

type TestResponseBodyResponse

type TestResponseBodyResponse struct {
	Response *TestResponseBodyResponse_Response `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

func (*TestResponseBodyResponse) Descriptor deprecated

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

Deprecated: Use TestResponseBodyResponse.ProtoReflect.Descriptor instead.

func (*TestResponseBodyResponse) GetResponse

func (*TestResponseBodyResponse) ProtoMessage

func (*TestResponseBodyResponse) ProtoMessage()

func (*TestResponseBodyResponse) ProtoReflect

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

func (*TestResponseBodyResponse) Reset

func (x *TestResponseBodyResponse) Reset()

func (*TestResponseBodyResponse) String

func (x *TestResponseBodyResponse) String() string

type TestResponseBodyResponse_Response

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

func (*TestResponseBodyResponse_Response) Descriptor deprecated

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

Deprecated: Use TestResponseBodyResponse_Response.ProtoReflect.Descriptor instead.

func (*TestResponseBodyResponse_Response) GetName

func (*TestResponseBodyResponse_Response) ProtoMessage

func (*TestResponseBodyResponse_Response) ProtoMessage()

func (*TestResponseBodyResponse_Response) ProtoReflect

func (*TestResponseBodyResponse_Response) Reset

func (*TestResponseBodyResponse_Response) String

type TestServer

type TestServer interface {
	GetItem(context.Context, *GetItemRequest) (*Item, error)
	CreateItem(context.Context, *CreateItemRequest) (*Item, error)
	ListItems(context.Context, *emptypb.Empty) (*ListItemsResponse, error)
	TestResponseBody(context.Context, *emptypb.Empty) (*TestResponseBodyResponse, error)
	// contains filtered or unexported methods
}

TestServer is the server API for Test service. All implementations must embed UnimplementedTestServer for forward compatibility

type UnimplementedTestServer

type UnimplementedTestServer struct {
}

UnimplementedTestServer must be embedded to have forward compatible implementations.

func (UnimplementedTestServer) CreateItem

func (UnimplementedTestServer) GetItem

func (UnimplementedTestServer) ListItems

func (UnimplementedTestServer) TestResponseBody

type UnsafeTestServer

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

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

Jump to

Keyboard shortcuts

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