examples

package
v0.72.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_greeter_proto protoreflect.FileDescriptor
View Source
var Greeter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "examples.Greeter",
	HandlerType: (*GreeterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SayHello",
			Handler:    _Greeter_SayHello_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SayHelloStream",
			Handler:       _Greeter_SayHelloStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "greeter.proto",
}

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

Functions

func RegisterGreeterServer added in v0.51.0

func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer)

Types

type GreeterClient added in v0.51.0

type GreeterClient interface {
	SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error)
	SayHelloStream(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (Greeter_SayHelloStreamClient, error)
}

GreeterClient is the client API for Greeter 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 NewGreeterClient added in v0.51.0

func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient

type GreeterServer added in v0.51.0

type GreeterServer interface {
	SayHello(context.Context, *HelloRequest) (*HelloReply, error)
	SayHelloStream(*HelloRequest, Greeter_SayHelloStreamServer) error
	// contains filtered or unexported methods
}

GreeterServer is the server API for Greeter service. All implementations must embed UnimplementedGreeterServer for forward compatibility

type Greeter_SayHelloStreamClient added in v0.51.0

type Greeter_SayHelloStreamClient interface {
	Recv() (*HelloReply, error)
	grpc.ClientStream
}

type Greeter_SayHelloStreamServer added in v0.51.0

type Greeter_SayHelloStreamServer interface {
	Send(*HelloReply) error
	grpc.ServerStream
}

type HelloReply added in v0.51.0

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

The response message containing the greetings

func (*HelloReply) Descriptor deprecated added in v0.51.0

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

Deprecated: Use HelloReply.ProtoReflect.Descriptor instead.

func (*HelloReply) GetMessage added in v0.51.0

func (x *HelloReply) GetMessage() string

func (*HelloReply) ProtoMessage added in v0.51.0

func (*HelloReply) ProtoMessage()

func (*HelloReply) ProtoReflect added in v0.65.0

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

func (*HelloReply) Reset added in v0.51.0

func (x *HelloReply) Reset()

func (*HelloReply) String added in v0.51.0

func (x *HelloReply) String() string

type HelloRequest added in v0.51.0

type HelloRequest struct {
	Firstname string `protobuf:"bytes,1,opt,name=firstname,proto3" json:"firstname,omitempty"`
	Lastname  string `protobuf:"bytes,2,opt,name=lastname,proto3" json:"lastname,omitempty"`
	// contains filtered or unexported fields
}

The request message containing the user's name.

func (*HelloRequest) Descriptor deprecated added in v0.51.0

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetFirstname added in v0.51.0

func (x *HelloRequest) GetFirstname() string

func (*HelloRequest) GetLastname added in v0.51.0

func (x *HelloRequest) GetLastname() string

func (*HelloRequest) ProtoMessage added in v0.51.0

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect added in v0.65.0

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

func (*HelloRequest) Reset added in v0.51.0

func (x *HelloRequest) Reset()

func (*HelloRequest) String added in v0.51.0

func (x *HelloRequest) String() string

type UnimplementedGreeterServer added in v0.51.0

type UnimplementedGreeterServer struct {
}

UnimplementedGreeterServer must be embedded to have forward compatible implementations.

func (UnimplementedGreeterServer) SayHello added in v0.51.0

func (UnimplementedGreeterServer) SayHelloStream added in v0.51.0

type UnsafeGreeterServer added in v0.65.0

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

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

type User added in v0.23.0

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

func (*User) Descriptor deprecated added in v0.23.0

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetFirstname added in v0.23.0

func (x *User) GetFirstname() string

func (*User) GetLastname added in v0.23.0

func (x *User) GetLastname() string

func (*User) ProtoMessage added in v0.23.0

func (*User) ProtoMessage()

func (*User) ProtoReflect added in v0.65.0

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

func (*User) Reset added in v0.23.0

func (x *User) Reset()

func (*User) String added in v0.23.0

func (x *User) String() string

Jump to

Keyboard shortcuts

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