ploker

package module
v0.0.0-...-7c29973 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

README

Ploker - Simple Planning Poker

Ploker provides a server and webasm-based web client for planning poker.

The server functions merely as a state-keeping and session-management service. HTML rendering and logic exists mostly in the client.

In order to create a session, go to the home page and click New Session.

image

This will generate a new session with a new session ID. To join an existing session, you can share the URL of the session with your teammates (i.e. http://poker.fritterware.org/session/[your session ID])

image

Each teammate can vote with the number buttons. When everyone has voted, you may click Reveal, at which point everyone's scores will be revealed after a countdown.

image image image

After the reveal, click the Reset button to start another round.

Documentation

Index

Constants

View Source
const (
	WorldUpdate = iota
	UserUpdate
	ResetUpdate
	RevealUpdate
)

Variables

This section is empty.

Functions

func GetSessionID

func GetSessionID(surl string) (string, error)

GetSessionID is used to retrieve the session ID from a given ploker URL.

func Reset

func Reset(ctx context.Context, c *websocket.Conn) error

Reset is used by clients. It sends a reset update to the server, causing the server to reset all state for the session.

func Reveal

func Reveal(ctx context.Context, c *websocket.Conn, k string, v interface{}) error

Reveal is used by clients. It sends a "reveal" update to the server, causing the server to count down visually for all clients before setting k = v in the world state.

func SendState

func SendState(ctx context.Context, c *websocket.Conn, s State) error

SendState serializes and sends a State object over connection c.

func UpdateUser

func UpdateUser(ctx context.Context, c *websocket.Conn, k string, v interface{}) error

UpdateUser is used by clients. It sends an update over connection c, telling the server to update the client state associated with its websocket, setting k = v.

func UpdateWorld

func UpdateWorld(ctx context.Context, c *websocket.Conn, k string, v interface{}) error

UpdateWorld is used by clients. It sends an update to the server, setting k = v in the world state.

Types

type State

type State struct {
	// client id -> client state
	Clients map[uint32]map[string]interface{}
	World   map[string]interface{}
}

State keeps track of the world state. Clients map client ID to client state. World keeps track of global state for a session.

func NewState

func NewState() State

func ReceiveState

func ReceiveState(ctx context.Context, c *websocket.Conn) (*State, error)

ReceiveState receives a State object over connection c.

type Update

type Update struct {
	Type  int
	Key   string
	Value interface{}
}

func ReceiveUpdate

func ReceiveUpdate(ctx context.Context, c *websocket.Conn) (*Update, error)

ReceiveUpdate is used by a server to receive Update objects from clients. It returns successfully deserialized Update objects or reports errors for deserialization or connection errors.

Directories

Path Synopsis
cmd
client command
server command

Jump to

Keyboard shortcuts

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