Documentation ¶
Index ¶
- Variables
- type JoinValidator
- type JoinValidatorData
- type Player
- type Repository
- type Service
- func (r *Service) CreateSession(name string, levelId uuid.UUID) (*uuid.UUID, error)
- func (r *Service) FindAllSessions() ([]*Session, error)
- func (r *Service) FindSession(id uuid.UUID) (*Session, error)
- func (r *Service) GetUpdates(sessionId, playerId uuid.UUID) (*Session, error)
- func (r *Service) JoinSession(sessionId, playerId uuid.UUID) (*Session, error)
- func (r *Service) LeaveSession(sessionId, playerId uuid.UUID) error
- type Session
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NotFound = errors.New("session not found")
)
Functions ¶
This section is empty.
Types ¶
type JoinValidator ¶
type JoinValidator struct {
// contains filtered or unexported fields
}
func NewJoinValidator ¶
func NewJoinValidator(sessionRepository Repository) *JoinValidator
func (*JoinValidator) Validate ¶
func (r *JoinValidator) Validate(data JoinValidatorData) (err error)
type Repository ¶
type Repository interface { CreateSession(session Session) (*Session, error) AddPlayerToSession(sessionId uuid.UUID, playerId uuid.UUID) (*Session, error) RemovePlayerFromSession(sessionId uuid.UUID, playerId uuid.UUID) (*Session, error) FindSession(id uuid.UUID) (*Session, error) FindAllSessions() ([]*Session, error) }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewSessionService ¶
func NewSessionService(sessionRepository Repository) *Service
func (*Service) CreateSession ¶
func (*Service) FindAllSessions ¶
func (*Service) GetUpdates ¶
TODO: add some validations TODO: this method is incomplete, think about what it needs to do
func (*Service) JoinSession ¶
Click to show internal directories.
Click to hide internal directories.