Documentation
¶
Overview ¶
Package pixelit provides a client for using the PixelIt API.
Usage:
import "github.com/darrenparkinson/pixelit-go" client := pixelit.NewClient(host, nil)
Copyright 2021 The pixelit-go AUTHORS. All rights reserved.
Use of this source code is governed by an MIT-style license that can be found in the LICENSE file. Code generated by gen-accessors; DO NOT EDIT.
Index ¶
Constants ¶
const ( ErrBadRequest = Err("pixelit: bad request") ErrForbidden = Err("pixelit: forbidden") ErrNotFound = Err("pixelit: not found") ErrInternalError = Err("pixelit: internal error") ErrUnknown = Err("pixelit: unexpected error occurred") )
Error Constants
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func Float64 ¶
Float64 is a helper routine that allocates a new Float64 value to store v and returns a pointer to it.
func Int ¶
Int is a helper routine that allocates a new int value to store v and returns a pointer to it.
Types ¶
type Bitmap ¶
type Bitmap struct { Data []int `json:"data,omitempty"` // Required Position *Position `json:"position,omitempty"` // Required Size *Size `json:"size,omitempty"` // Required }
func (*Bitmap) GetPosition ¶
GetPosition returns the Position field.
type BitmapAnimation ¶
type BitmapAnimation struct { Data [][]int `json:"data"` //Required. Only 8x8 BMPs are supported here! AnimationDelay int `json:"animationDelay"` // Required. Higher is a slower animation Rubberbanding bool `json:"rubberbanding"` // Should the animation run back and forth LimitLoops int `json:"limitLoops"` // If the repetition is to be limited }
type Client ¶
type Client struct { // BaseURL for PixelIt Display. Set using `pixelit.NewClient()` automatically via the host parameter, or set directly. BaseURL string // Host IP for PixelIt Display. Set using `pixelit.NewClient()`, or set directly. Host string //HTTP Client to use for making requests, allowing the user to supply their own if required. HTTPClient *http.Client }
Client is the main pixelit client for interacting with the library. It can be created using NewClient
func NewClient ¶
NewClient is a helper function that returns a new pixelit client given a host name or IP. Optionally you can provide your own http client or use nil to use the default. This is done to ensure you're aware of the decision you're making to not provide your own http client.
func (*Client) SendInstagramFollowers ¶
func (*Client) SendScreen ¶
func (*Client) SendTiktokFollowers ¶
type Clock ¶
type Clock struct { Show *bool `json:"show,omitempty"` // Required SwitchAktiv *bool `json:"switchAktiv,omitempty"` // Switch clock / date WithSeconds *bool `json:"withSeconds,omitempty"` // Show seconds SwitchSec *int `json:"switchSec,omitempty"` // Switch clock / date in seconds. Required when SwitchAktiv is true DrawWeekDays *bool `json:"drawWeekDays,omitempty"` // Draw weekday blocks at the bottom Color *Color `json:"color,omitempty"` // Color of clock HexColor string `json:"hexColor,omitempty"` // Alternative to Color, e.g. #FFFFFF }
func (*Clock) GetDrawWeekDays ¶
GetDrawWeekDays returns the DrawWeekDays field if it's non-nil, zero value otherwise.
func (*Clock) GetSwitchAktiv ¶
GetSwitchAktiv returns the SwitchAktiv field if it's non-nil, zero value otherwise.
func (*Clock) GetSwitchSec ¶
GetSwitchSec returns the SwitchSec field if it's non-nil, zero value otherwise.
func (*Clock) GetWithSeconds ¶
GetWithSeconds returns the WithSeconds field if it's non-nil, zero value otherwise.
type Screen ¶
type Screen struct { SleepMode *bool `json:"sleepMode,omitempty"` Brightness *bool `json:"brightness,omitempty"` Text *Text `json:"text,omitempty"` SwitchAnimation *SwitchAnimation `json:"switchAnimation,omitempty"` Clock *Clock `json:"clock,omitempty"` Bitmap *Bitmap `json:"bitmap,omitempty"` Bitmaps []Bitmap `json:"bitmaps,omitempty"` // When displaying multiple bitmaps, animated bitmaps, scrolling or text are not supported! BitmapAnimation *BitmapAnimation `json:"bitmapAnimation,omitempty"` }
func (*Screen) GetBitmapAnimation ¶
func (s *Screen) GetBitmapAnimation() *BitmapAnimation
GetBitmapAnimation returns the BitmapAnimation field.
func (*Screen) GetBrightness ¶
GetBrightness returns the Brightness field if it's non-nil, zero value otherwise.
func (*Screen) GetSleepMode ¶
GetSleepMode returns the SleepMode field if it's non-nil, zero value otherwise.
func (*Screen) GetSwitchAnimation ¶
func (s *Screen) GetSwitchAnimation() *SwitchAnimation
GetSwitchAnimation returns the SwitchAnimation field.
type SwitchAnimation ¶
type SwitchAnimation struct { Aktiv *bool `json:"aktiv,omitempty"` Animation *string `json:"animation,omitempty"` Data *[]int `json:"data,omitempty"` Width *int `json:"width,omitempty"` }
func (*SwitchAnimation) GetAktiv ¶
func (s *SwitchAnimation) GetAktiv() bool
GetAktiv returns the Aktiv field if it's non-nil, zero value otherwise.
func (*SwitchAnimation) GetAnimation ¶
func (s *SwitchAnimation) GetAnimation() string
GetAnimation returns the Animation field if it's non-nil, zero value otherwise.
func (*SwitchAnimation) GetData ¶
func (s *SwitchAnimation) GetData() []int
GetData returns the Data field if it's non-nil, zero value otherwise.
func (*SwitchAnimation) GetWidth ¶
func (s *SwitchAnimation) GetWidth() int
GetWidth returns the Width field if it's non-nil, zero value otherwise.
type Text ¶
type Text struct { TextString *string `json:"textString,omitempty"` // Required. Displayed Text. BigFont *bool `json:"bigFont,omitempty"` // Required. Big Font. CenterText *bool `json:"centerText,omitempty"` // Required. ScrollText *string `json:"scrollText,omitempty"` // One of true, false or auto. ScrollTextDelay *int `json:"scrollTextDelay,omitempty"` // Required if ScrollText is set. 1-9999. Position *Position `json:"position,omitempty"` // Required. Color *Color `json:"color,omitempty"` // Required unless hex color specified. HexColor *string `json:"hexColor,omitempty"` // Alternative to Color. }
func (*Text) GetBigFont ¶
GetBigFont returns the BigFont field if it's non-nil, zero value otherwise.
func (*Text) GetCenterText ¶
GetCenterText returns the CenterText field if it's non-nil, zero value otherwise.
func (*Text) GetHexColor ¶
GetHexColor returns the HexColor field if it's non-nil, zero value otherwise.
func (*Text) GetPosition ¶
GetPosition returns the Position field.
func (*Text) GetScrollText ¶
GetScrollText returns the ScrollText field if it's non-nil, zero value otherwise.
func (*Text) GetScrollTextDelay ¶
GetScrollTextDelay returns the ScrollTextDelay field if it's non-nil, zero value otherwise.
func (*Text) GetTextString ¶
GetTextString returns the TextString field if it's non-nil, zero value otherwise.