search_proto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 8 Imported by: 0

README

generate go file

protoc --go_out=. --go_opt=paths=source_relative\
 --go-grpc_out=. --go-grpc_opt=paths=source_relative\
  --go-grpc_opt=require_unimplemented_servers=false *.proto

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_search_proto protoreflect.FileDescriptor
View Source
var SearchService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "SearchService",
	HandlerType: (*SearchServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Search",
			Handler:    _SearchService_Search_Handler,
		},
		{
			MethodName: "CurrentTime",
			Handler:    _SearchService_CurrentTime_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "search.proto",
}

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

Functions

func RegisterSearchServiceServer

func RegisterSearchServiceServer(s grpc.ServiceRegistrar, srv SearchServiceServer)

Types

type SearchRequest

type SearchRequest struct {
	StaffName string `protobuf:"bytes,1,opt,name=staffName,proto3" json:"staffName,omitempty"`
	Gender    bool   `protobuf:"varint,2,opt,name=gender,proto3" json:"gender,omitempty"`
	Age       uint32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchRequest) Descriptor deprecated

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

Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.

func (*SearchRequest) GetAge

func (x *SearchRequest) GetAge() uint32

func (*SearchRequest) GetGender

func (x *SearchRequest) GetGender() bool

func (*SearchRequest) GetStaffName

func (x *SearchRequest) GetStaffName() string

func (*SearchRequest) ProtoMessage

func (*SearchRequest) ProtoMessage()

func (*SearchRequest) ProtoReflect

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

func (*SearchRequest) Reset

func (x *SearchRequest) Reset()

func (*SearchRequest) String

func (x *SearchRequest) String() string

type SearchResponse

type SearchResponse struct {
	StaffID   int64  `protobuf:"varint,1,opt,name=staffID,proto3" json:"staffID,omitempty"`
	StaffName string `protobuf:"bytes,2,opt,name=staffName,proto3" json:"staffName,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchResponse) Descriptor deprecated

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

Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead.

func (*SearchResponse) GetStaffID

func (x *SearchResponse) GetStaffID() int64

func (*SearchResponse) GetStaffName

func (x *SearchResponse) GetStaffName() string

func (*SearchResponse) ProtoMessage

func (*SearchResponse) ProtoMessage()

func (*SearchResponse) ProtoReflect

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

func (*SearchResponse) Reset

func (x *SearchResponse) Reset()

func (*SearchResponse) String

func (x *SearchResponse) String() string

type SearchServiceClient

type SearchServiceClient interface {
	Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
	CurrentTime(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeResponse, error)
}

SearchServiceClient is the client API for SearchService 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 SearchServiceServer

type SearchServiceServer interface {
	Search(context.Context, *SearchRequest) (*SearchResponse, error)
	CurrentTime(context.Context, *TimeRequest) (*TimeResponse, error)
}

SearchServiceServer is the server API for SearchService service. All implementations should embed UnimplementedSearchServiceServer for forward compatibility

type TimeRequest

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

func (*TimeRequest) Descriptor deprecated

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

Deprecated: Use TimeRequest.ProtoReflect.Descriptor instead.

func (*TimeRequest) ProtoMessage

func (*TimeRequest) ProtoMessage()

func (*TimeRequest) ProtoReflect

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

func (*TimeRequest) Reset

func (x *TimeRequest) Reset()

func (*TimeRequest) String

func (x *TimeRequest) String() string

type TimeResponse

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

func (*TimeResponse) Descriptor deprecated

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

Deprecated: Use TimeResponse.ProtoReflect.Descriptor instead.

func (*TimeResponse) GetCurrentTime

func (x *TimeResponse) GetCurrentTime() string

func (*TimeResponse) ProtoMessage

func (*TimeResponse) ProtoMessage()

func (*TimeResponse) ProtoReflect

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

func (*TimeResponse) Reset

func (x *TimeResponse) Reset()

func (*TimeResponse) String

func (x *TimeResponse) String() string

type UnimplementedSearchServiceServer

type UnimplementedSearchServiceServer struct {
}

UnimplementedSearchServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedSearchServiceServer) CurrentTime

func (UnimplementedSearchServiceServer) Search

type UnsafeSearchServiceServer

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

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

Jump to

Keyboard shortcuts

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