greetpb

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GreetService_Greet_FullMethodName       = "/greet.v1.GreetService/Greet"
	GreetService_GreetGroup_FullMethodName  = "/greet.v1.GreetService/GreetGroup"
	GreetService_StreamGreet_FullMethodName = "/greet.v1.GreetService/StreamGreet"
)

Variables

View Source
var (
	Mood_name = map[int32]string{
		0: "MOOD_UNSPECIFIED",
		1: "MOOD_HAPPY",
		2: "MOOD_SAD",
	}
	Mood_value = map[string]int32{
		"MOOD_UNSPECIFIED": 0,
		"MOOD_HAPPY":       1,
		"MOOD_SAD":         2,
	}
)

Enum value maps for Mood.

View Source
var File_greet_proto protoreflect.FileDescriptor
View Source
var GreetService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "greet.v1.GreetService",
	HandlerType: (*GreetServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Greet",
			Handler:    _GreetService_Greet_Handler,
		},
		{
			MethodName: "GreetGroup",
			Handler:    _GreetService_GreetGroup_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "StreamGreet",
			Handler:       _GreetService_StreamGreet_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "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 RegisterGreetServiceServer added in v0.3.0

func RegisterGreetServiceServer(s grpc.ServiceRegistrar, srv GreetServiceServer)

Types

type GreetGroupRequest

type GreetGroupRequest struct {

	// People to greet.
	People []*Person `protobuf:"bytes,1,rep,name=people,proto3" json:"people,omitempty"`
	// contains filtered or unexported fields
}

Request to greet a group of people.

func (*GreetGroupRequest) Descriptor deprecated

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

Deprecated: Use GreetGroupRequest.ProtoReflect.Descriptor instead.

func (*GreetGroupRequest) GetPeople

func (x *GreetGroupRequest) GetPeople() []*Person

func (*GreetGroupRequest) ProtoMessage

func (*GreetGroupRequest) ProtoMessage()

func (*GreetGroupRequest) ProtoReflect

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

func (*GreetGroupRequest) Reset

func (x *GreetGroupRequest) Reset()

func (*GreetGroupRequest) String

func (x *GreetGroupRequest) String() string

type GreetGroupResponse

type GreetGroupResponse struct {

	// Individual greetings.
	Messages []string `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
	// Number of people greeted.
	Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

Response with greetings for the group.

func (*GreetGroupResponse) Descriptor deprecated

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

Deprecated: Use GreetGroupResponse.ProtoReflect.Descriptor instead.

func (*GreetGroupResponse) GetCount

func (x *GreetGroupResponse) GetCount() int32

func (*GreetGroupResponse) GetMessages

func (x *GreetGroupResponse) GetMessages() []string

func (*GreetGroupResponse) ProtoMessage

func (*GreetGroupResponse) ProtoMessage()

func (*GreetGroupResponse) ProtoReflect

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

func (*GreetGroupResponse) Reset

func (x *GreetGroupResponse) Reset()

func (*GreetGroupResponse) String

func (x *GreetGroupResponse) String() string

type GreetRequest

type GreetRequest struct {

	// Name of the person to greet.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Optional mood for the greeting.
	Mood *Mood `protobuf:"varint,2,opt,name=mood,proto3,enum=greet.v1.Mood,oneof" json:"mood,omitempty"`
	// Optional metadata tags.
	Tags map[string]string `` /* 135-byte string literal not displayed */
	// contains filtered or unexported fields
}

Request for the Greet RPC.

func (*GreetRequest) Descriptor deprecated

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

Deprecated: Use GreetRequest.ProtoReflect.Descriptor instead.

func (*GreetRequest) GetMood

func (x *GreetRequest) GetMood() Mood

func (*GreetRequest) GetName

func (x *GreetRequest) GetName() string

func (*GreetRequest) GetTags

func (x *GreetRequest) GetTags() map[string]string

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 {

	// The greeting message.
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// Mood used in the greeting.
	Mood Mood `protobuf:"varint,2,opt,name=mood,proto3,enum=greet.v1.Mood" json:"mood,omitempty"`
	// Tags echoed back.
	Tags map[string]string `` /* 135-byte string literal not displayed */
	// contains filtered or unexported fields
}

Response from the Greet RPC.

func (*GreetResponse) Descriptor deprecated

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

Deprecated: Use GreetResponse.ProtoReflect.Descriptor instead.

func (*GreetResponse) GetMessage

func (x *GreetResponse) GetMessage() string

func (*GreetResponse) GetMood

func (x *GreetResponse) GetMood() Mood

func (*GreetResponse) GetTags

func (x *GreetResponse) GetTags() map[string]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 added in v0.3.0

type GreetServiceClient interface {
	// Greet a person by name.
	Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error)
	// Greet multiple people at once.
	GreetGroup(ctx context.Context, in *GreetGroupRequest, opts ...grpc.CallOption) (*GreetGroupResponse, error)
	// Stream greetings — one response message per chunk.
	StreamGreet(ctx context.Context, in *StreamGreetRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[GreetResponse], 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.

A simple greeting service.

func NewGreetServiceClient added in v0.3.0

func NewGreetServiceClient(cc grpc.ClientConnInterface) GreetServiceClient

type GreetServiceServer added in v0.3.0

type GreetServiceServer interface {
	// Greet a person by name.
	Greet(context.Context, *GreetRequest) (*GreetResponse, error)
	// Greet multiple people at once.
	GreetGroup(context.Context, *GreetGroupRequest) (*GreetGroupResponse, error)
	// Stream greetings — one response message per chunk.
	StreamGreet(*StreamGreetRequest, grpc.ServerStreamingServer[GreetResponse]) error
	// contains filtered or unexported methods
}

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

A simple greeting service.

type GreetService_StreamGreetClient added in v0.3.0

type GreetService_StreamGreetClient = grpc.ServerStreamingClient[GreetResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type GreetService_StreamGreetServer added in v0.3.0

type GreetService_StreamGreetServer = grpc.ServerStreamingServer[GreetResponse]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Mood

type Mood int32

Mood of a greeting.

const (
	// Unspecified mood.
	Mood_MOOD_UNSPECIFIED Mood = 0
	// A happy mood.
	Mood_MOOD_HAPPY Mood = 1
	// A sad mood.
	Mood_MOOD_SAD Mood = 2
)

func (Mood) Descriptor

func (Mood) Descriptor() protoreflect.EnumDescriptor

func (Mood) Enum

func (x Mood) Enum() *Mood

func (Mood) EnumDescriptor deprecated

func (Mood) EnumDescriptor() ([]byte, []int)

Deprecated: Use Mood.Descriptor instead.

func (Mood) Number

func (x Mood) Number() protoreflect.EnumNumber

func (Mood) String

func (x Mood) String() string

func (Mood) Type

func (Mood) Type() protoreflect.EnumType

type Person

type Person struct {

	// Name of the person.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Their mood.
	Mood Mood `protobuf:"varint,2,opt,name=mood,proto3,enum=greet.v1.Mood" json:"mood,omitempty"`
	// contains filtered or unexported fields
}

A person in a group.

func (*Person) Descriptor deprecated

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

Deprecated: Use Person.ProtoReflect.Descriptor instead.

func (*Person) GetMood

func (x *Person) GetMood() Mood

func (*Person) GetName

func (x *Person) GetName() string

func (*Person) ProtoMessage

func (*Person) ProtoMessage()

func (*Person) ProtoReflect

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

func (*Person) Reset

func (x *Person) Reset()

func (*Person) String

func (x *Person) String() string

type StreamGreetRequest added in v0.0.2

type StreamGreetRequest struct {

	// Name of the person to greet.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Number of greetings to emit (default 1).
	Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

Request for the StreamGreet RPC.

func (*StreamGreetRequest) Descriptor deprecated added in v0.0.2

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

Deprecated: Use StreamGreetRequest.ProtoReflect.Descriptor instead.

func (*StreamGreetRequest) GetCount added in v0.0.2

func (x *StreamGreetRequest) GetCount() int32

func (*StreamGreetRequest) GetName added in v0.0.2

func (x *StreamGreetRequest) GetName() string

func (*StreamGreetRequest) ProtoMessage added in v0.0.2

func (*StreamGreetRequest) ProtoMessage()

func (*StreamGreetRequest) ProtoReflect added in v0.0.2

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

func (*StreamGreetRequest) Reset added in v0.0.2

func (x *StreamGreetRequest) Reset()

func (*StreamGreetRequest) String added in v0.0.2

func (x *StreamGreetRequest) String() string

type UnimplementedGreetServiceServer added in v0.3.0

type UnimplementedGreetServiceServer struct{}

UnimplementedGreetServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedGreetServiceServer) Greet added in v0.3.0

func (UnimplementedGreetServiceServer) GreetGroup added in v0.3.0

func (UnimplementedGreetServiceServer) StreamGreet added in v0.3.0

type UnsafeGreetServiceServer added in v0.3.0

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

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