example

package
v0.0.0-...-6dd2113 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_example_proto protoreflect.FileDescriptor
View Source
var Greeter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Greeter",
	HandlerType: (*GreeterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Greet",
			Handler:    _Greeter_Greet_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "example.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)

View Source
var Namer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Namer",
	HandlerType: (*NamerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Name",
			Handler:    _Namer_Name_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "example.proto",
}

Namer_ServiceDesc is the grpc.ServiceDesc for Namer 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

func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer)

func RegisterNamerServer

func RegisterNamerServer(s grpc.ServiceRegistrar, srv NamerServer)

func TLSConfig

func TLSConfig() *tls.Config

Types

type GreetRequest

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

func (*GreetRequest) Descriptor deprecated

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

Deprecated: Use GreetRequest.ProtoReflect.Descriptor instead.

func (*GreetRequest) ProtoMessage

func (*GreetRequest) ProtoMessage()

func (*GreetRequest) ProtoReflect

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

func (*GreetRequest) Reset

func (x *GreetRequest) Reset()

func (*GreetRequest) String

func (x *GreetRequest) String() string

type GreetResponse

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

func (*GreetResponse) Descriptor deprecated

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

Deprecated: Use GreetResponse.ProtoReflect.Descriptor instead.

func (*GreetResponse) GetGreeting

func (x *GreetResponse) GetGreeting() string

func (*GreetResponse) ProtoMessage

func (*GreetResponse) ProtoMessage()

func (*GreetResponse) ProtoReflect

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

func (*GreetResponse) Reset

func (x *GreetResponse) Reset()

func (*GreetResponse) String

func (x *GreetResponse) String() string

type GreeterClient

type GreeterClient interface {
	Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, 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

func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient

type GreeterServer

type GreeterServer interface {
	Greet(context.Context, *GreetRequest) (*GreetResponse, error)
	// contains filtered or unexported methods
}

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

type NameRequest

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

func (*NameRequest) Descriptor deprecated

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

Deprecated: Use NameRequest.ProtoReflect.Descriptor instead.

func (*NameRequest) ProtoMessage

func (*NameRequest) ProtoMessage()

func (*NameRequest) ProtoReflect

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

func (*NameRequest) Reset

func (x *NameRequest) Reset()

func (*NameRequest) String

func (x *NameRequest) String() string

type NameResponse

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

func (*NameResponse) Descriptor deprecated

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

Deprecated: Use NameResponse.ProtoReflect.Descriptor instead.

func (*NameResponse) GetName

func (x *NameResponse) GetName() string

func (*NameResponse) ProtoMessage

func (*NameResponse) ProtoMessage()

func (*NameResponse) ProtoReflect

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

func (*NameResponse) Reset

func (x *NameResponse) Reset()

func (*NameResponse) String

func (x *NameResponse) String() string

type NamerClient

type NamerClient interface {
	Name(ctx context.Context, in *NameRequest, opts ...grpc.CallOption) (*NameResponse, error)
}

NamerClient is the client API for Namer 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 NewNamerClient

func NewNamerClient(cc grpc.ClientConnInterface) NamerClient

type NamerServer

type NamerServer interface {
	Name(context.Context, *NameRequest) (*NameResponse, error)
	// contains filtered or unexported methods
}

NamerServer is the server API for Namer service. All implementations must embed UnimplementedNamerServer for forward compatibility

type UnimplementedGreeterServer

type UnimplementedGreeterServer struct {
}

UnimplementedGreeterServer must be embedded to have forward compatible implementations.

func (UnimplementedGreeterServer) Greet

type UnimplementedNamerServer

type UnimplementedNamerServer struct {
}

UnimplementedNamerServer must be embedded to have forward compatible implementations.

func (UnimplementedNamerServer) Name

type UnsafeGreeterServer

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 UnsafeNamerServer

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

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

Jump to

Keyboard shortcuts

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