internal

package
v0.0.0-...-81485c5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProductOwner = "product-owner"
	Developer    = "developer"
)
View Source
const (
	Guess     = "guess"
	NewRound  = "new-round"
	Estimate  = "estimate"
	LockRoom  = "lock-room"
	OpenRoom  = "open-room"
	SkipRound = "skip"
	Reveal    = "reveal"
)

Variables

This section is empty.

Functions

func HandleEstimate

func HandleEstimate(msg message.Message) (*message.Message, error)

func HandleGuess

func HandleGuess(msg message.Message) (*message.Message, error)

func HandleLockRoom

func HandleLockRoom(msg message.Message) (*message.Message, error)

func HandleNewRound

func HandleNewRound(msg message.Message) (*message.Message, error)

func HandleOpenRoom

func HandleOpenRoom(msg message.Message) (*message.Message, error)

func HandleReveal

func HandleReveal(msg message.Message) (*message.Message, error)

func HandleSkipRound

func HandleSkipRound(msg message.Message) (*message.Message, error)

Types

type Client

type Client struct {
	Name string
	Role string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(name, role string, room *Room, connection *websocket.Conn, bus message.Bus) *Client

func (*Client) ToJson

func (client *Client) ToJson() UserDTO

func (*Client) WebsocketReader

func (client *Client) WebsocketReader()

func (*Client) WebsocketWriter

func (client *Client) WebsocketWriter()

type EstimatePayload

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

type GuessConfig

type GuessConfig struct {
	Guesses []GuessConfigEntry
}

func NewGuessConfig

func NewGuessConfig(possibleGuesses, possibleGuessesDescription string) (*GuessConfig, error)

type GuessConfigEntry

type GuessConfigEntry struct {
	Guess       int    `json:"guess"`
	Description string `json:"description"`
}

type GuessPayload

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

type LockRoomPayload

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

type Message

type Message struct {
	Type string `json:"type"`
	Data any    `json:"data"`
}

func NewJoin

func NewJoin() *Message

type NewRoundPayload

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

type OpenRoomPayload

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

type RevealPayload

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

type Room

type Room struct {
	Id         RoomId
	InProgress bool

	Join      chan *Client
	Clients   map[*Client]bool
	Broadcast chan *Message

	NameOfCreator  string
	IsLocked       bool
	Key            uuid.UUID
	HashedPassword []byte
	Created        time.Time
	// contains filtered or unexported fields
}

func NewRoom

func NewRoom(name RoomId, destroy chan<- RoomId, nameOfCreator string) *Room

func (*Room) MarshalJSON

func (room *Room) MarshalJSON() ([]byte, error)

func (*Room) Run

func (room *Room) Run()

func (*Room) Verify

func (room *Room) Verify(password string) bool

type RoomId

type RoomId string

type SkipRoundPayload

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

type UserDTO

type UserDTO map[string]any

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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