Documentation ¶
Index ¶
- type BlankCanvas
- func (i *BlankCanvas) AlwaysRender() bool
- func (i *BlankCanvas) At(x, y int) color.Color
- func (i *BlankCanvas) Bounds() image.Rectangle
- func (i *BlankCanvas) Clear() error
- func (i *BlankCanvas) Close() error
- func (i *BlankCanvas) ColorModel() color.Model
- func (i *BlankCanvas) Disable() bool
- func (i *BlankCanvas) Enable() bool
- func (i *BlankCanvas) Enabled() bool
- func (i *BlankCanvas) GetHTTPHandlers() ([]*HTTPHandler, error)
- func (i *BlankCanvas) GetWidth() int
- func (i *BlankCanvas) Name() string
- func (i *BlankCanvas) Render(ctx context.Context) error
- func (i *BlankCanvas) Scrollable() bool
- func (i *BlankCanvas) Set(x, y int, clr color.Color)
- func (i *BlankCanvas) SetStateChangeCallback(s func())
- func (i *BlankCanvas) SetWidth(x int)
- func (i *BlankCanvas) Store(s bool) bool
- type Board
- type Canvas
- type Enabler
- type HTTPHandler
- type StateChangeNotifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlankCanvas ¶
BlankCanvas is a board.Canvas type that does not render
func NewBlankCanvas ¶
func NewBlankCanvas(width int, height int, logger *zap.Logger) *BlankCanvas
NewBlankCanvas ...
func (*BlankCanvas) At ¶
func (i *BlankCanvas) At(x, y int) color.Color
At returns the color of the pixel at (x, y)
func (*BlankCanvas) Bounds ¶
func (i *BlankCanvas) Bounds() image.Rectangle
Bounds return the topology of the Canvas
func (*BlankCanvas) ColorModel ¶
func (i *BlankCanvas) ColorModel() color.Model
ColorModel returns the canvas' color model, always color.RGBAModel
func (*BlankCanvas) GetHTTPHandlers ¶
func (i *BlankCanvas) GetHTTPHandlers() ([]*HTTPHandler, error)
GetHTTPHandlers ...
func (*BlankCanvas) Render ¶
func (i *BlankCanvas) Render(ctx context.Context) error
Render stores the state of the image as a PNG
func (*BlankCanvas) Set ¶
func (i *BlankCanvas) Set(x, y int, clr color.Color)
Set set LED at position x,y to the provided 24-bit color value
func (*BlankCanvas) SetStateChangeCallback ¶
func (i *BlankCanvas) SetStateChangeCallback(s func())
func (*BlankCanvas) Store ¶
func (i *BlankCanvas) Store(s bool) bool
type Board ¶
type Board interface { Name() string Render(ctx context.Context, canvases Canvas) error GetHTTPHandlers() ([]*HTTPHandler, error) GetRPCHandler() (string, http.Handler) InBetween() bool Enabler() Enabler }
Board is the interface to implement for displaying on the matrix
type Canvas ¶
type Canvas interface { image.Image draw.Image Enabler Name() string Clear() error Render(ctx context.Context) error GetHTTPHandlers() ([]*HTTPHandler, error) Close() error Scrollable() bool AlwaysRender() bool SetWidth(int) GetWidth() int }
Canvas ...
type Enabler ¶
type Enabler interface { Enabled() bool Enable() bool Disable() bool Store(bool) bool SetStateChangeCallback(func()) }
Enabler is an interface for basic Enable/Disable functions
type HTTPHandler ¶
type HTTPHandler struct { Handler func(http.ResponseWriter, *http.Request) Path string }
HTTPHandler is the type returned to the sportsmatrix for HTTP endpoints
type StateChangeNotifier ¶
type StateChangeNotifier func()
StateChangeNotifier is a func that an Enabler uses to notify when its enabled/disabled state changes