protos

package
v0.0.0-...-4d90a73 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoomService_CreatedRoom_FullMethodName = "/RoomService/CreatedRoom"
	RoomService_JoinRoom_FullMethodName    = "/RoomService/JoinRoom"
)

Variables

View Source
var RoomService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "RoomService",
	HandlerType: (*RoomServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreatedRoom",
			Handler:    _RoomService_CreatedRoom_Handler,
		},
		{
			MethodName: "JoinRoom",
			Handler:    _RoomService_JoinRoom_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "room.proto",
}

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

Functions

func RegisterRoomServiceServer

func RegisterRoomServiceServer(s grpc.ServiceRegistrar, srv RoomServiceServer)

Types

type CreatedRoomRequest

type CreatedRoomRequest struct {
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // room master the name
	// contains filtered or unexported fields
}

func (*CreatedRoomRequest) Descriptor deprecated

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

Deprecated: Use CreatedRoomRequest.ProtoReflect.Descriptor instead.

func (*CreatedRoomRequest) GetName

func (x *CreatedRoomRequest) GetName() string

func (*CreatedRoomRequest) ProtoMessage

func (*CreatedRoomRequest) ProtoMessage()

func (*CreatedRoomRequest) ProtoReflect

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

func (*CreatedRoomRequest) Reset

func (x *CreatedRoomRequest) Reset()

func (*CreatedRoomRequest) String

func (x *CreatedRoomRequest) String() string

type CreatedRoomResponse

type CreatedRoomResponse struct {
	Id    string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`       // is room id
	Users []*User `protobuf:"bytes,3,rep,name=users,proto3" json:"users,omitempty"` // user array
	// contains filtered or unexported fields
}

func (*CreatedRoomResponse) Descriptor deprecated

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

Deprecated: Use CreatedRoomResponse.ProtoReflect.Descriptor instead.

func (*CreatedRoomResponse) GetId

func (x *CreatedRoomResponse) GetId() string

func (*CreatedRoomResponse) GetUsers

func (x *CreatedRoomResponse) GetUsers() []*User

func (*CreatedRoomResponse) ProtoMessage

func (*CreatedRoomResponse) ProtoMessage()

func (*CreatedRoomResponse) ProtoReflect

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

func (*CreatedRoomResponse) Reset

func (x *CreatedRoomResponse) Reset()

func (*CreatedRoomResponse) String

func (x *CreatedRoomResponse) String() string

type JoinRoomRequest

type JoinRoomRequest struct {
	RoomId string `protobuf:"bytes,1,opt,name=roomId,proto3" json:"roomId,omitempty"` // room id
	Name   string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`     // in to room use the name
	// contains filtered or unexported fields
}

func (*JoinRoomRequest) Descriptor deprecated

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

Deprecated: Use JoinRoomRequest.ProtoReflect.Descriptor instead.

func (*JoinRoomRequest) GetName

func (x *JoinRoomRequest) GetName() string

func (*JoinRoomRequest) GetRoomId

func (x *JoinRoomRequest) GetRoomId() string

func (*JoinRoomRequest) ProtoMessage

func (*JoinRoomRequest) ProtoMessage()

func (*JoinRoomRequest) ProtoReflect

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

func (*JoinRoomRequest) Reset

func (x *JoinRoomRequest) Reset()

func (*JoinRoomRequest) String

func (x *JoinRoomRequest) String() string

type JoinedRoomResponse

type JoinedRoomResponse struct {
	Id        string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // is room id
	Timestamp int64   `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Users     []*User `protobuf:"bytes,3,rep,name=users,proto3" json:"users,omitempty"` // user array
	// contains filtered or unexported fields
}

func (*JoinedRoomResponse) Descriptor deprecated

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

Deprecated: Use JoinedRoomResponse.ProtoReflect.Descriptor instead.

func (*JoinedRoomResponse) GetId

func (x *JoinedRoomResponse) GetId() string

func (*JoinedRoomResponse) GetTimestamp

func (x *JoinedRoomResponse) GetTimestamp() int64

func (*JoinedRoomResponse) GetUsers

func (x *JoinedRoomResponse) GetUsers() []*User

func (*JoinedRoomResponse) ProtoMessage

func (*JoinedRoomResponse) ProtoMessage()

func (*JoinedRoomResponse) ProtoReflect

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

func (*JoinedRoomResponse) Reset

func (x *JoinedRoomResponse) Reset()

func (*JoinedRoomResponse) String

func (x *JoinedRoomResponse) String() string

type RoomServiceClient

type RoomServiceClient interface {
	// create a Room
	CreatedRoom(ctx context.Context, in *CreatedRoomRequest, opts ...grpc.CallOption) (*CreatedRoomResponse, error)
	// in to room
	JoinRoom(ctx context.Context, in *JoinRoomRequest, opts ...grpc.CallOption) (*JoinedRoomResponse, error)
}

RoomServiceClient is the client API for RoomService 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 RoomServiceServer

type RoomServiceServer interface {
	// create a Room
	CreatedRoom(context.Context, *CreatedRoomRequest) (*CreatedRoomResponse, error)
	// in to room
	JoinRoom(context.Context, *JoinRoomRequest) (*JoinedRoomResponse, error)
	// contains filtered or unexported methods
}

RoomServiceServer is the server API for RoomService service. All implementations must embed UnimplementedRoomServiceServer for forward compatibility.

type UnimplementedRoomServiceServer

type UnimplementedRoomServiceServer struct{}

UnimplementedRoomServiceServer 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 (UnimplementedRoomServiceServer) CreatedRoom

func (UnimplementedRoomServiceServer) JoinRoom

type UnsafeRoomServiceServer

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

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

type User

type User struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name    string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Avatar  string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"`
	Balance int32  `protobuf:"varint,4,opt,name=balance,proto3" json:"balance,omitempty"` // init default 0, this value can < 0
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetAvatar

func (x *User) GetAvatar() string

func (*User) GetBalance

func (x *User) GetBalance() int32

func (*User) GetId

func (x *User) GetId() string

func (*User) GetName

func (x *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

Jump to

Keyboard shortcuts

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