Documentation
¶
Index ¶
- Variables
- func RegisterExampleServiceServer(s *grpc.Server, srv ExampleServiceServer)
- type EmptyStringValidationError
- type ExampleServiceClient
- type ExampleServiceServer
- type HelloRequest
- func (*HelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HelloRequest) GetAge() int32
- func (x *HelloRequest) GetName() string
- func (*HelloRequest) ProtoMessage()
- func (x *HelloRequest) ProtoReflect() protoreflect.Message
- func (x *HelloRequest) Reset()
- func (x *HelloRequest) String() string
- func (r *HelloRequest) Validate() error
- type HelloResponse
- type Server
- type UnimplementedExampleServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_example_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterExampleServiceServer ¶
func RegisterExampleServiceServer(s *grpc.Server, srv ExampleServiceServer)
Types ¶
type EmptyStringValidationError ¶
type EmptyStringValidationError struct {
FieldName string
}
EmptyStringValidationError caused by expected `string` field must contains non-empty value.
func (EmptyStringValidationError) Error ¶
func (e EmptyStringValidationError) Error() string
Error std error interface impl.
type ExampleServiceClient ¶
type ExampleServiceClient interface { Greet(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) Crash(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) }
ExampleServiceClient is the client API for ExampleService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewExampleServiceClient ¶
func NewExampleServiceClient(cc grpc.ClientConnInterface) ExampleServiceClient
type ExampleServiceServer ¶
type ExampleServiceServer interface { Greet(context.Context, *HelloRequest) (*HelloResponse, error) Crash(context.Context, *emptypb.Empty) (*emptypb.Empty, error) }
ExampleServiceServer is the server API for ExampleService service.
type HelloRequest ¶
type HelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` // contains filtered or unexported fields }
func (*HelloRequest) Descriptor
deprecated
func (*HelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) GetAge ¶
func (x *HelloRequest) GetAge() int32
func (*HelloRequest) GetName ¶
func (x *HelloRequest) GetName() string
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) ProtoReflect ¶
func (x *HelloRequest) ProtoReflect() protoreflect.Message
func (*HelloRequest) Reset ¶
func (x *HelloRequest) Reset()
func (*HelloRequest) String ¶
func (x *HelloRequest) String() string
func (*HelloRequest) Validate ¶
func (r *HelloRequest) Validate() error
Validate grpc_validator.middleware impl. will return codes.InvalidArgument.
type HelloResponse ¶
type HelloResponse struct { Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` // contains filtered or unexported fields }
func (*HelloResponse) Descriptor
deprecated
func (*HelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.
func (*HelloResponse) GetGreeting ¶
func (x *HelloResponse) GetGreeting() string
func (*HelloResponse) ProtoMessage ¶
func (*HelloResponse) ProtoMessage()
func (*HelloResponse) ProtoReflect ¶
func (x *HelloResponse) ProtoReflect() protoreflect.Message
func (*HelloResponse) Reset ¶
func (x *HelloResponse) Reset()
func (*HelloResponse) String ¶
func (x *HelloResponse) String() string
type Server ¶
type Server struct{}
Server - ExampleServiceServer example.
func (*Server) Greet ¶
func (s *Server) Greet(ctx context.Context, req *HelloRequest) (*HelloResponse, error)
Greet - ExampleServiceServer impl.
type UnimplementedExampleServiceServer ¶
type UnimplementedExampleServiceServer struct { }
UnimplementedExampleServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedExampleServiceServer) Greet ¶
func (*UnimplementedExampleServiceServer) Greet(context.Context, *HelloRequest) (*HelloResponse, error)