infrastructure

package
v0.0.0-...-6edf9ef Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_session_proto protoreflect.FileDescriptor
View Source
var Level_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "session.level",
	HandlerType: (*LevelServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "UploadLevel",
			Handler:    _Level_UploadLevel_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListLevels",
			Handler:       _Level_ListLevels_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "session.proto",
}

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

View Source
var Session_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "session.session",
	HandlerType: (*SessionServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateSession",
			Handler:    _Session_CreateSession_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "JoinSession",
			Handler:       _Session_JoinSession_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "ListSessions",
			Handler:       _Session_ListSessions_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "session.proto",
}

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

Functions

func RegisterLevelServer

func RegisterLevelServer(s grpc.ServiceRegistrar, srv LevelServer)

func RegisterSessionServer

func RegisterSessionServer(s grpc.ServiceRegistrar, srv SessionServer)

Types

type CreateLevelRequest

type CreateLevelRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateLevelRequest) Descriptor deprecated

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

Deprecated: Use CreateLevelRequest.ProtoReflect.Descriptor instead.

func (*CreateLevelRequest) GetData

func (x *CreateLevelRequest) GetData() []byte

func (*CreateLevelRequest) GetName

func (x *CreateLevelRequest) GetName() string

func (*CreateLevelRequest) ProtoMessage

func (*CreateLevelRequest) ProtoMessage()

func (*CreateLevelRequest) ProtoReflect

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

func (*CreateLevelRequest) Reset

func (x *CreateLevelRequest) Reset()

func (*CreateLevelRequest) String

func (x *CreateLevelRequest) String() string

type CreateSessionRequest

type CreateSessionRequest struct {
	Name    string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Region  string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
	LevelId string `protobuf:"bytes,3,opt,name=level_id,json=levelId,proto3" json:"level_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateSessionRequest) Descriptor deprecated

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

Deprecated: Use CreateSessionRequest.ProtoReflect.Descriptor instead.

func (*CreateSessionRequest) GetLevelId

func (x *CreateSessionRequest) GetLevelId() string

func (*CreateSessionRequest) GetName

func (x *CreateSessionRequest) GetName() string

func (*CreateSessionRequest) GetRegion

func (x *CreateSessionRequest) GetRegion() string

func (*CreateSessionRequest) ProtoMessage

func (*CreateSessionRequest) ProtoMessage()

func (*CreateSessionRequest) ProtoReflect

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

func (*CreateSessionRequest) Reset

func (x *CreateSessionRequest) Reset()

func (*CreateSessionRequest) String

func (x *CreateSessionRequest) String() string

type JoinEvent

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

func (*JoinEvent) Descriptor deprecated

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

Deprecated: Use JoinEvent.ProtoReflect.Descriptor instead.

func (*JoinEvent) GetSessionId

func (x *JoinEvent) GetSessionId() string

func (*JoinEvent) ProtoMessage

func (*JoinEvent) ProtoMessage()

func (*JoinEvent) ProtoReflect

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

func (*JoinEvent) Reset

func (x *JoinEvent) Reset()

func (*JoinEvent) String

func (x *JoinEvent) String() string

type JoinSessionRequest

type JoinSessionRequest struct {

	// Types that are assignable to Event:
	//
	//	*JoinSessionRequest_Join
	//	*JoinSessionRequest_Ping
	Event isJoinSessionRequest_Event `protobuf_oneof:"event"`
	// contains filtered or unexported fields
}

func (*JoinSessionRequest) Descriptor deprecated

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

Deprecated: Use JoinSessionRequest.ProtoReflect.Descriptor instead.

func (*JoinSessionRequest) GetEvent

func (m *JoinSessionRequest) GetEvent() isJoinSessionRequest_Event

func (*JoinSessionRequest) GetJoin

func (x *JoinSessionRequest) GetJoin() *JoinEvent

func (*JoinSessionRequest) GetPing

func (x *JoinSessionRequest) GetPing() *PingEvent

func (*JoinSessionRequest) ProtoMessage

func (*JoinSessionRequest) ProtoMessage()

func (*JoinSessionRequest) ProtoReflect

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

func (*JoinSessionRequest) Reset

func (x *JoinSessionRequest) Reset()

func (*JoinSessionRequest) String

func (x *JoinSessionRequest) String() string

type JoinSessionRequest_Join

type JoinSessionRequest_Join struct {
	Join *JoinEvent `protobuf:"bytes,1,opt,name=join,proto3,oneof"`
}

type JoinSessionRequest_Ping

type JoinSessionRequest_Ping struct {
	Ping *PingEvent `protobuf:"bytes,2,opt,name=ping,proto3,oneof"`
}

type Level

type Level 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"`
	Difficulty int32  `protobuf:"varint,3,opt,name=difficulty,proto3" json:"difficulty,omitempty"`
	// contains filtered or unexported fields
}

func (*Level) Descriptor deprecated

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

Deprecated: Use Level.ProtoReflect.Descriptor instead.

func (*Level) GetDifficulty

func (x *Level) GetDifficulty() int32

func (*Level) GetId

func (x *Level) GetId() string

func (*Level) GetName

func (x *Level) GetName() string

func (*Level) ProtoMessage

func (*Level) ProtoMessage()

func (*Level) ProtoReflect

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

func (*Level) Reset

func (x *Level) Reset()

func (*Level) String

func (x *Level) String() string

type LevelClient

type LevelClient interface {
	UploadLevel(ctx context.Context, in *CreateLevelRequest, opts ...grpc.CallOption) (*Level, error)
	ListLevels(ctx context.Context, in *ListLevelsRequest, opts ...grpc.CallOption) (Level_ListLevelsClient, error)
}

LevelClient is the client API for Level 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 NewLevelClient

func NewLevelClient(cc grpc.ClientConnInterface) LevelClient

type LevelServer

type LevelServer interface {
	UploadLevel(context.Context, *CreateLevelRequest) (*Level, error)
	ListLevels(*ListLevelsRequest, Level_ListLevelsServer) error
	// contains filtered or unexported methods
}

LevelServer is the server API for Level service. All implementations must embed UnimplementedLevelServer for forward compatibility

type LevelState

type LevelState struct {
	SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	Progress  int32  `protobuf:"varint,2,opt,name=progress,proto3" json:"progress,omitempty"`
	// contains filtered or unexported fields
}

func (*LevelState) Descriptor deprecated

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

Deprecated: Use LevelState.ProtoReflect.Descriptor instead.

func (*LevelState) GetProgress

func (x *LevelState) GetProgress() int32

func (*LevelState) GetSessionId

func (x *LevelState) GetSessionId() string

func (*LevelState) ProtoMessage

func (*LevelState) ProtoMessage()

func (*LevelState) ProtoReflect

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

func (*LevelState) Reset

func (x *LevelState) Reset()

func (*LevelState) String

func (x *LevelState) String() string

type Level_ListLevelsClient

type Level_ListLevelsClient interface {
	Recv() (*Level, error)
	grpc.ClientStream
}

type Level_ListLevelsServer

type Level_ListLevelsServer interface {
	Send(*Level) error
	grpc.ServerStream
}

type ListLevelsRequest

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

func (*ListLevelsRequest) Descriptor deprecated

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

Deprecated: Use ListLevelsRequest.ProtoReflect.Descriptor instead.

func (*ListLevelsRequest) ProtoMessage

func (*ListLevelsRequest) ProtoMessage()

func (*ListLevelsRequest) ProtoReflect

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

func (*ListLevelsRequest) Reset

func (x *ListLevelsRequest) Reset()

func (*ListLevelsRequest) String

func (x *ListLevelsRequest) String() string

type ListSessionsRequest

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

func (*ListSessionsRequest) Descriptor deprecated

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

Deprecated: Use ListSessionsRequest.ProtoReflect.Descriptor instead.

func (*ListSessionsRequest) GetRegion

func (x *ListSessionsRequest) GetRegion() string

func (*ListSessionsRequest) ProtoMessage

func (*ListSessionsRequest) ProtoMessage()

func (*ListSessionsRequest) ProtoReflect

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

func (*ListSessionsRequest) Reset

func (x *ListSessionsRequest) Reset()

func (*ListSessionsRequest) String

func (x *ListSessionsRequest) String() string

type MockSessionRepository

type MockSessionRepository struct {
}

func NewMockSessionRepository

func NewMockSessionRepository() *MockSessionRepository

func (*MockSessionRepository) AddPlayerToSession

func (r *MockSessionRepository) AddPlayerToSession(sessionId uuid.UUID, playerId uuid.UUID) (*session.Session, error)

func (*MockSessionRepository) CreateSession

func (r *MockSessionRepository) CreateSession(session session.Session) (*session.Session, error)

func (*MockSessionRepository) FindAllSessions

func (r *MockSessionRepository) FindAllSessions() ([]*session.Session, error)

func (*MockSessionRepository) FindSession

func (r *MockSessionRepository) FindSession(id uuid.UUID) (*session.Session, error)

func (*MockSessionRepository) RemovePlayerFromSession

func (r *MockSessionRepository) RemovePlayerFromSession(sessionId uuid.UUID, playerId uuid.UUID) (*session.Session, error)

type MongoSessionRepository

type MongoSessionRepository struct {
}

type PingEvent

type PingEvent struct {
	LevelState *LevelState          `protobuf:"bytes,1,opt,name=level_state,json=levelState,proto3" json:"level_state,omitempty"`
	Timestamp  *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

func (*PingEvent) Descriptor deprecated

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

Deprecated: Use PingEvent.ProtoReflect.Descriptor instead.

func (*PingEvent) GetLevelState

func (x *PingEvent) GetLevelState() *LevelState

func (*PingEvent) GetTimestamp

func (x *PingEvent) GetTimestamp() *timestamp.Timestamp

func (*PingEvent) ProtoMessage

func (*PingEvent) ProtoMessage()

func (*PingEvent) ProtoReflect

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

func (*PingEvent) Reset

func (x *PingEvent) Reset()

func (*PingEvent) String

func (x *PingEvent) String() string

type Session

type Session 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"`
	Level      *Level `protobuf:"bytes,3,opt,name=level,proto3" json:"level,omitempty"`
	NumPlayers int32  `protobuf:"varint,4,opt,name=numPlayers,proto3" json:"numPlayers,omitempty"`
	// contains filtered or unexported fields
}

func (*Session) Descriptor deprecated

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

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetId

func (x *Session) GetId() string

func (*Session) GetLevel

func (x *Session) GetLevel() *Level

func (*Session) GetName

func (x *Session) GetName() string

func (*Session) GetNumPlayers

func (x *Session) GetNumPlayers() int32

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

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

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

type SessionClient

type SessionClient interface {
	CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*Session, error)
	JoinSession(ctx context.Context, opts ...grpc.CallOption) (Session_JoinSessionClient, error)
	ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (Session_ListSessionsClient, error)
}

SessionClient is the client API for Session 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 NewSessionClient

func NewSessionClient(cc grpc.ClientConnInterface) SessionClient

type SessionServer

type SessionServer interface {
	CreateSession(context.Context, *CreateSessionRequest) (*Session, error)
	JoinSession(Session_JoinSessionServer) error
	ListSessions(*ListSessionsRequest, Session_ListSessionsServer) error
	// contains filtered or unexported methods
}

SessionServer is the server API for Session service. All implementations must embed UnimplementedSessionServer for forward compatibility

type Session_JoinSessionClient

type Session_JoinSessionClient interface {
	Send(*JoinSessionRequest) error
	CloseAndRecv() (*Session, error)
	grpc.ClientStream
}

type Session_JoinSessionServer

type Session_JoinSessionServer interface {
	SendAndClose(*Session) error
	Recv() (*JoinSessionRequest, error)
	grpc.ServerStream
}

type Session_ListSessionsClient

type Session_ListSessionsClient interface {
	Recv() (*Session, error)
	grpc.ClientStream
}

type Session_ListSessionsServer

type Session_ListSessionsServer interface {
	Send(*Session) error
	grpc.ServerStream
}

type UnimplementedLevelServer

type UnimplementedLevelServer struct {
}

UnimplementedLevelServer must be embedded to have forward compatible implementations.

func (UnimplementedLevelServer) ListLevels

func (UnimplementedLevelServer) UploadLevel

type UnimplementedSessionServer

type UnimplementedSessionServer struct {
}

UnimplementedSessionServer must be embedded to have forward compatible implementations.

func (UnimplementedSessionServer) CreateSession

func (UnimplementedSessionServer) JoinSession

func (UnimplementedSessionServer) ListSessions

type UnsafeLevelServer

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

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

type UnsafeSessionServer

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

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

Jump to

Keyboard shortcuts

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