mechpixel

package
v0.0.0-...-a3e6692 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mechpixel dispenses drawings of scenes associated with a particular shutterbug.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPixelHandleFunc

func NewPixelHandleFunc(
	d Dispenser,
	shutterbugs mechshutterbug.Containser,
) http.HandlerFunc

NewPixelHandleFunc creates a HTTP request handler which allows clients to interface with the dispenser.

The handler upgrades the HTTP request to a websocket. The websocket's first ever incoming message should be a valid shutterbug.

Types

type Dispenser

type Dispenser struct {
	Logger *log.Logger
	// contains filtered or unexported fields
}

A Dispenser of pixels.

func NewDispenser

func NewDispenser(l *log.Logger) Dispenser

NewDispenser constructs a new Dispenser.

func (Dispenser) Dispense

func (d Dispenser) Dispense(shutterbug string, pix wiregl.BinaryPixelData)

Dispense the given pixels to the viewers of the shutterbug.

func (Dispenser) RemoveShutterbug

func (d Dispenser) RemoveShutterbug(shutterbug string)

RemoveShutterbug from the dispenser and close the associated HTTP request handlers using that shutterbug.

Jump to

Keyboard shortcuts

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