matchmaking

package
v0.0.59 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package matchmaking is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	MatchService_Match_FullMethodName = "/matchmaking.v1.MatchService/Match"
)

Variables

View Source
var File_matchmaking_matchmaking_proto protoreflect.FileDescriptor
View Source
var MatchService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "matchmaking.v1.MatchService",
	HandlerType: (*MatchServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Match",
			Handler:       _MatchService_Match_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "matchmaking/matchmaking.proto",
}

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

Functions

func RegisterMatchServiceHandler

func RegisterMatchServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMatchServiceHandler registers the http handlers for service MatchService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMatchServiceHandlerClient

func RegisterMatchServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MatchServiceClient) error

RegisterMatchServiceHandlerClient registers the http handlers for service MatchService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MatchServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MatchServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MatchServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.

func RegisterMatchServiceHandlerFromEndpoint

func RegisterMatchServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterMatchServiceHandlerFromEndpoint is same as RegisterMatchServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterMatchServiceHandlerServer

func RegisterMatchServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MatchServiceServer) error

RegisterMatchServiceHandlerServer registers the http handlers for service MatchService to "mux". UnaryRPC :call MatchServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMatchServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.

func RegisterMatchServiceServer

func RegisterMatchServiceServer(s grpc.ServiceRegistrar, srv MatchServiceServer)

Types

type MatchRequest

type MatchRequest struct {
	UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`
	GameId string `protobuf:"bytes,2,opt,name=gameId,proto3" json:"gameId,omitempty"`
	// contains filtered or unexported fields
}

func (*MatchRequest) Descriptor deprecated

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

Deprecated: Use MatchRequest.ProtoReflect.Descriptor instead.

func (*MatchRequest) GetGameId

func (x *MatchRequest) GetGameId() string

func (*MatchRequest) GetUserId

func (x *MatchRequest) GetUserId() string

func (*MatchRequest) ProtoMessage

func (*MatchRequest) ProtoMessage()

func (*MatchRequest) ProtoReflect

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

func (*MatchRequest) Reset

func (x *MatchRequest) Reset()

func (*MatchRequest) String

func (x *MatchRequest) String() string

type MatchResponse

type MatchResponse struct {
	MatchId string    `protobuf:"bytes,1,opt,name=matchId,proto3" json:"matchId,omitempty"`
	UserIds []*Ticket `protobuf:"bytes,2,rep,name=userIds,proto3" json:"userIds,omitempty"`
	GameId  string    `protobuf:"bytes,3,opt,name=gameId,proto3" json:"gameId,omitempty"`
	// contains filtered or unexported fields
}

func (*MatchResponse) Descriptor deprecated

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

Deprecated: Use MatchResponse.ProtoReflect.Descriptor instead.

func (*MatchResponse) GetGameId

func (x *MatchResponse) GetGameId() string

func (*MatchResponse) GetMatchId

func (x *MatchResponse) GetMatchId() string

func (*MatchResponse) GetUserIds

func (x *MatchResponse) GetUserIds() []*Ticket

func (*MatchResponse) ProtoMessage

func (*MatchResponse) ProtoMessage()

func (*MatchResponse) ProtoReflect

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

func (*MatchResponse) Reset

func (x *MatchResponse) Reset()

func (*MatchResponse) String

func (x *MatchResponse) String() string

type MatchServiceClient

type MatchServiceClient interface {
	Match(ctx context.Context, in *MatchRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[MatchResponse], error)
}

MatchServiceClient is the client API for MatchService 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 MatchServiceServer

type MatchServiceServer interface {
	Match(*MatchRequest, grpc.ServerStreamingServer[MatchResponse]) error
}

MatchServiceServer is the server API for MatchService service. All implementations should embed UnimplementedMatchServiceServer for forward compatibility.

type MatchService_MatchClient

type MatchService_MatchClient = grpc.ServerStreamingClient[MatchResponse]

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

type MatchService_MatchServer

type MatchService_MatchServer = grpc.ServerStreamingServer[MatchResponse]

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

type Ticket

type Ticket struct {
	TicketId string `protobuf:"bytes,1,opt,name=ticketId,proto3" json:"ticketId,omitempty"`
	UserId   string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"`
	GameId   string `protobuf:"bytes,3,opt,name=gameId,proto3" json:"gameId,omitempty"`
	MatchId  string `protobuf:"bytes,4,opt,name=matchId,proto3" json:"matchId,omitempty"`
	Status   string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*Ticket) Descriptor deprecated

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

Deprecated: Use Ticket.ProtoReflect.Descriptor instead.

func (*Ticket) GetGameId

func (x *Ticket) GetGameId() string

func (*Ticket) GetMatchId

func (x *Ticket) GetMatchId() string

func (*Ticket) GetStatus

func (x *Ticket) GetStatus() string

func (*Ticket) GetTicketId

func (x *Ticket) GetTicketId() string

func (*Ticket) GetUserId

func (x *Ticket) GetUserId() string

func (*Ticket) ProtoMessage

func (*Ticket) ProtoMessage()

func (*Ticket) ProtoReflect

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

func (*Ticket) Reset

func (x *Ticket) Reset()

func (*Ticket) String

func (x *Ticket) String() string

type UnimplementedMatchServiceServer

type UnimplementedMatchServiceServer struct{}

UnimplementedMatchServiceServer should 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 (UnimplementedMatchServiceServer) Match

type UnsafeMatchServiceServer

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

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

Jump to

Keyboard shortcuts

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