roompb

package
v0.0.0-...-7483216 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Room_Join_FullMethodName  = "/room.Room/Join"
	Room_Say_FullMethodName   = "/room.Room/Say"
	Room_Leave_FullMethodName = "/room.Room/Leave"
)

Variables

View Source
var (
	ReplyCode_name = map[int32]string{
		0: "UNSPECIFIED",
		1: "NEWS",
	}
	ReplyCode_value = map[string]int32{
		"UNSPECIFIED": 0,
		"NEWS":        1,
	}
)

Enum value maps for ReplyCode.

View Source
var (
	// optional cluster.Services reply_service = 60000;
	E_ReplyService = &file_room_service_proto_extTypes[0]
	// optional room.ReplyCode reply_code = 60001;
	E_ReplyCode = &file_room_service_proto_extTypes[1]
)

Extension fields to descriptorpb.MessageOptions.

View Source
var File_room_service_proto protoreflect.FileDescriptor
View Source
var Room_MethodReplyCodes = map[string]int32{}

Room_MethodReplyCodes 每个grpc方法返回值对应的nodehub.Reply.code

View Source
var Room_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "room.Room",
	HandlerType: (*RoomServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Join",
			Handler:    _Room_Join_Handler,
		},
		{
			MethodName: "Say",
			Handler:    _Room_Say_Handler,
		},
		{
			MethodName: "Leave",
			Handler:    _Room_Leave_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "room/service.proto",
}

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

Functions

func PackNews

func PackNews(msg *News) (*nh.Reply, error)

func RegisterRoomServer

func RegisterRoomServer(s grpc.ServiceRegistrar, srv RoomServer)

Types

type JoinRequest

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

func (*JoinRequest) Descriptor deprecated

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

Deprecated: Use JoinRequest.ProtoReflect.Descriptor instead.

func (*JoinRequest) GetName

func (x *JoinRequest) GetName() string

func (*JoinRequest) ProtoMessage

func (*JoinRequest) ProtoMessage()

func (*JoinRequest) ProtoReflect

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

func (*JoinRequest) Reset

func (x *JoinRequest) Reset()

func (*JoinRequest) String

func (x *JoinRequest) String() string

type News

type News struct {
	FromId   string `protobuf:"bytes,1,opt,name=from_id,json=fromId,proto3" json:"from_id,omitempty"`
	FromName string `protobuf:"bytes,2,opt,name=from_name,json=fromName,proto3" json:"from_name,omitempty"`
	Content  string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*News) Descriptor deprecated

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

Deprecated: Use News.ProtoReflect.Descriptor instead.

func (*News) GetContent

func (x *News) GetContent() string

func (*News) GetFromId

func (x *News) GetFromId() string

func (*News) GetFromName

func (x *News) GetFromName() string

func (*News) ProtoMessage

func (*News) ProtoMessage()

func (*News) ProtoReflect

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

func (*News) Reset

func (x *News) Reset()

func (*News) String

func (x *News) String() string

type ReplyCode

type ReplyCode int32
const (
	ReplyCode_UNSPECIFIED ReplyCode = 0
	ReplyCode_NEWS        ReplyCode = 1
)

func (ReplyCode) Descriptor

func (ReplyCode) Descriptor() protoreflect.EnumDescriptor

func (ReplyCode) Enum

func (x ReplyCode) Enum() *ReplyCode

func (ReplyCode) EnumDescriptor deprecated

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

Deprecated: Use ReplyCode.Descriptor instead.

func (ReplyCode) Number

func (x ReplyCode) Number() protoreflect.EnumNumber

func (ReplyCode) String

func (x ReplyCode) String() string

func (ReplyCode) Type

type RoomClient

type RoomClient interface {
	Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Say(ctx context.Context, in *SayRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Leave(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

RoomClient is the client API for Room 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 NewRoomClient

func NewRoomClient(cc grpc.ClientConnInterface) RoomClient

type RoomServer

type RoomServer interface {
	Join(context.Context, *JoinRequest) (*emptypb.Empty, error)
	Say(context.Context, *SayRequest) (*emptypb.Empty, error)
	Leave(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

RoomServer is the server API for Room service. All implementations must embed UnimplementedRoomServer for forward compatibility.

type SayRequest

type SayRequest struct {
	To      string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"`
	Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*SayRequest) Descriptor deprecated

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

Deprecated: Use SayRequest.ProtoReflect.Descriptor instead.

func (*SayRequest) GetContent

func (x *SayRequest) GetContent() string

func (*SayRequest) GetTo

func (x *SayRequest) GetTo() string

func (*SayRequest) ProtoMessage

func (*SayRequest) ProtoMessage()

func (*SayRequest) ProtoReflect

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

func (*SayRequest) Reset

func (x *SayRequest) Reset()

func (*SayRequest) String

func (x *SayRequest) String() string

type UnimplementedRoomServer

type UnimplementedRoomServer struct{}

UnimplementedRoomServer 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 (UnimplementedRoomServer) Join

func (UnimplementedRoomServer) Leave

func (UnimplementedRoomServer) Say

type UnsafeRoomServer

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

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

Jump to

Keyboard shortcuts

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