greet

package
v0.0.0-...-b015d54 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_pkg_greet_greet_proto protoreflect.FileDescriptor
View Source
var GreetService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "greet.GreetService",
	HandlerType: (*GreetServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Greet",
			Handler:    _GreetService_Greet_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GreetStream",
			Handler:       _GreetService_GreetStream_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Multiply",
			Handler:       _GreetService_Multiply_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "Hello",
			Handler:       _GreetService_Hello_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "Upload",
			Handler:       _GreetService_Upload_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "pkg/greet/greet.proto",
}

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

Functions

func CallGreet

func CallGreet(ctx context.Context, client GreetServiceClient) (err error)

->, <-

func CallGreetStream

func CallGreetStream(ctx context.Context, client GreetServiceClient) (err error)

->, <---

func CallHello

func CallHello(ctx context.Context, client GreetServiceClient) (err error)

->, <---

func CallMultiply

func CallMultiply(ctx context.Context, client GreetServiceClient) (err error)

--->, <-

func CallUpload

func CallUpload(ctx context.Context, client GreetServiceClient) (err error)

func RegisterGreetServiceServer

func RegisterGreetServiceServer(s grpc.ServiceRegistrar, srv GreetServiceServer)

Types

type File

type File struct {
	Text    string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*File) Descriptor deprecated

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

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetContent

func (x *File) GetContent() []byte

func (*File) GetText

func (x *File) GetText() string

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) ProtoReflect

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

func (*File) Reset

func (x *File) Reset()

func (*File) String

func (x *File) String() string

type GreetClient

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

func NewGreetClient

func NewGreetClient(conn *grpc.ClientConn) *GreetClient

func (*GreetClient) Greet

func (client *GreetClient) Greet(ctx context.Context) (err error)

->, <-

func (*GreetClient) GreetStream

func (client *GreetClient) GreetStream(ctx context.Context) (err error)

->, <---

func (*GreetClient) Hello

func (client *GreetClient) Hello(ctx context.Context) (err error)

->, <---

func (*GreetClient) Multiply

func (client *GreetClient) Multiply(ctx context.Context) (err error)

--->, <-

func (*GreetClient) Upload

func (client *GreetClient) Upload(ctx context.Context) (err error)

type GreetRequest

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

func (*GreetRequest) Descriptor deprecated

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

Deprecated: Use GreetRequest.ProtoReflect.Descriptor instead.

func (*GreetRequest) GetGreeting

func (x *GreetRequest) GetGreeting() *Greeting

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 {
	Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*GreetResponse) Descriptor deprecated

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

Deprecated: Use GreetResponse.ProtoReflect.Descriptor instead.

func (*GreetResponse) GetResult

func (x *GreetResponse) GetResult() 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 GreetServiceClient

type GreetServiceClient interface {
	// unary
	Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error)
	// server streaming
	GreetStream(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (GreetService_GreetStreamClient, error)
	// client streaming
	Multiply(ctx context.Context, opts ...grpc.CallOption) (GreetService_MultiplyClient, error)
	// client and server streaming
	Hello(ctx context.Context, opts ...grpc.CallOption) (GreetService_HelloClient, error)
	// pending, in_progress, success, failed
	Upload(ctx context.Context, opts ...grpc.CallOption) (GreetService_UploadClient, error)
}

GreetServiceClient is the client API for GreetService 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 GreetServiceServer

type GreetServiceServer interface {
	// unary
	Greet(context.Context, *GreetRequest) (*GreetResponse, error)
	// server streaming
	GreetStream(*GreetRequest, GreetService_GreetStreamServer) error
	// client streaming
	Multiply(GreetService_MultiplyServer) error
	// client and server streaming
	Hello(GreetService_HelloServer) error
	// pending, in_progress, success, failed
	Upload(GreetService_UploadServer) error
}

GreetServiceServer is the server API for GreetService service. All implementations must embed UnimplementedGreetServiceServer for forward compatibility

type GreetService_GreetStreamClient

type GreetService_GreetStreamClient interface {
	Recv() (*GreetResponse, error)
	grpc.ClientStream
}

type GreetService_GreetStreamServer

type GreetService_GreetStreamServer interface {
	Send(*GreetResponse) error
	grpc.ServerStream
}

type GreetService_HelloClient

type GreetService_HelloClient interface {
	Send(*Msg) error
	Recv() (*Msg, error)
	grpc.ClientStream
}

type GreetService_HelloServer

type GreetService_HelloServer interface {
	Send(*Msg) error
	Recv() (*Msg, error)
	grpc.ServerStream
}

type GreetService_MultiplyClient

type GreetService_MultiplyClient interface {
	Send(*Number) error
	CloseAndRecv() (*Number, error)
	grpc.ClientStream
}

type GreetService_MultiplyServer

type GreetService_MultiplyServer interface {
	SendAndClose(*Number) error
	Recv() (*Number, error)
	grpc.ServerStream
}

type GreetService_UploadClient

type GreetService_UploadClient interface {
	Send(*File) error
	Recv() (*Msg, error)
	grpc.ClientStream
}

type GreetService_UploadServer

type GreetService_UploadServer interface {
	Send(*Msg) error
	Recv() (*File, error)
	grpc.ServerStream
}

type Greeting

type Greeting struct {

	// unary
	FirstName string `protobuf:"bytes,1,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
	LastName  string `protobuf:"bytes,2,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
	// contains filtered or unexported fields
}

func (*Greeting) Descriptor deprecated

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

Deprecated: Use Greeting.ProtoReflect.Descriptor instead.

func (*Greeting) GetFirstName

func (x *Greeting) GetFirstName() string

func (*Greeting) GetLastName

func (x *Greeting) GetLastName() string

func (*Greeting) ProtoMessage

func (*Greeting) ProtoMessage()

func (*Greeting) ProtoReflect

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

func (*Greeting) Reset

func (x *Greeting) Reset()

func (*Greeting) String

func (x *Greeting) String() string

type Msg

type Msg struct {
	Code int32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*Msg) Descriptor deprecated

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

Deprecated: Use Msg.ProtoReflect.Descriptor instead.

func (*Msg) GetCode

func (x *Msg) GetCode() int32

func (*Msg) GetText

func (x *Msg) GetText() string

func (*Msg) ProtoMessage

func (*Msg) ProtoMessage()

func (*Msg) ProtoReflect

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

func (*Msg) Reset

func (x *Msg) Reset()

func (*Msg) String

func (x *Msg) String() string

type Number

type Number struct {
	Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Number) Descriptor deprecated

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

Deprecated: Use Number.ProtoReflect.Descriptor instead.

func (*Number) GetValue

func (x *Number) GetValue() int64

func (*Number) ProtoMessage

func (*Number) ProtoMessage()

func (*Number) ProtoReflect

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

func (*Number) Reset

func (x *Number) Reset()

func (*Number) String

func (x *Number) String() string

type Server

type Server struct{}

func (*Server) Greet

func (srv *Server) Greet(ctx context.Context, req *GreetRequest) (res *GreetResponse, err error)

func (*Server) GreetStream

func (srv *Server) GreetStream(req *GreetRequest, stream GreetService_GreetStreamServer) (
	err error)

func (*Server) Hello

func (src *Server) Hello(stream GreetService_HelloServer) (err error)

func (*Server) Multiply

func (srv *Server) Multiply(stream GreetService_MultiplyServer) (err error)

func (*Server) Upload

func (src *Server) Upload(stream GreetService_UploadServer) (err error)

type UnimplementedGreetServiceServer

type UnimplementedGreetServiceServer struct {
}

UnimplementedGreetServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedGreetServiceServer) Greet

func (UnimplementedGreetServiceServer) GreetStream

func (UnimplementedGreetServiceServer) Hello

func (UnimplementedGreetServiceServer) Multiply

func (UnimplementedGreetServiceServer) Upload

type UnsafeGreetServiceServer

type UnsafeGreetServiceServer interface {
}

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

Jump to

Keyboard shortcuts

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