Documentation ¶
Index ¶
- Constants
- Variables
- func ImageFromURL(url string) (image.Image, error)
- func LoadFont(points float64) (font.Face, error)
- func LoadFonts(fonts fs.FS) error
- func RenderText(text string) image.Image
- type Agent
- type Config
- type ConfigAttribute
- type ID
- type Link
- type MTATimes
- type Spotify
- func (s *Spotify) GetAdditionalConfig() []ConfigAttribute
- func (s *Spotify) GetConfig() Config
- func (s *Spotify) GetName() ID
- func (s *Spotify) GetTick() time.Duration
- func (s *Spotify) NextFrame() (img image.Image)
- func (s *Spotify) RegisterEndpoints(r *gin.Engine)
- func (s *Spotify) SetConfig(config Config) error
- type Text
- type Ticker
- func (t *Ticker) GetAdditionalConfig() (attrs []ConfigAttribute)
- func (t *Ticker) GetConfig() Config
- func (t *Ticker) GetName() ID
- func (t *Ticker) GetTick() time.Duration
- func (t *Ticker) NextFrame() image.Image
- func (t *Ticker) RegisterEndpoints(_ *gin.Engine)
- func (t *Ticker) SetConfig(config Config) error
Constants ¶
View Source
const BankPrinterFontName = "F25_Bank_Printer.ttf"
Variables ¶
View Source
var (
ErrorFont font.Face
)
Functions ¶
func ImageFromURL ¶
ImageFromURL will create an image.Image from a URL
func RenderText ¶
RenderText will render the given string to a 64x64 image.Image
Types ¶
type Agent ¶
type Agent interface { // GetName will return the ID for the GetName() ID // GetConfig will return the current configuration of the Agent GetConfig() Config // SetConfig will set the configuration of the agent SetConfig(Config) error // GetAdditionalConfig will return a list of additional ConfigAttributes to display on the // config page GetAdditionalConfig() []ConfigAttribute // NextFrame will return the next image.Image to render to the display NextFrame() image.Image // GetTick will return the duration to sleep for between drawings GetTick() time.Duration // RegisterEndpoints will register agent specific endpoints to the HTTP Server RegisterEndpoints(r *gin.Engine) }
Agent represents a service that will draw to the matrix
func NewSpotifyAgent ¶
func NewTickerAgent ¶
func NewTickerAgent() Agent
type ConfigAttribute ¶
type ConfigAttribute interface { // GetHTML will return the html to be displayed GetHTML() string }
ConfigAttribute is an additional HTML attribute to display on the config page
type ID ¶
type ID = string
ID is an identifier used for labeling agents
const TickerAgentID ID = "StockTicker"
type Link ¶
type Link struct { // Name is the text to display as the link Name string // Href is the location of the link Href string }
Link is an HTML Link
type Spotify ¶
type Spotify struct {
// contains filtered or unexported fields
}
func (*Spotify) GetAdditionalConfig ¶
func (s *Spotify) GetAdditionalConfig() []ConfigAttribute
func (*Spotify) RegisterEndpoints ¶
type Text ¶
type Text struct { // Content is the content of the text blob Content string }
Text represents plain text to be displayed
type Ticker ¶
type Ticker struct {
// contains filtered or unexported fields
}
func (*Ticker) GetAdditionalConfig ¶
func (t *Ticker) GetAdditionalConfig() (attrs []ConfigAttribute)
func (*Ticker) RegisterEndpoints ¶
Click to show internal directories.
Click to hide internal directories.