v1

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

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.

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) Crash

func (s *Server) Crash(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)

Crash - ExampleServiceServer impl.

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) Crash

func (*UnimplementedExampleServiceServer) Greet

Jump to

Keyboard shortcuts

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